Skip to content

Commit 7f6dde7

Browse files
committed
fix: spelling mistakes
1 parent 2a215f3 commit 7f6dde7

File tree

13 files changed

+56
-56
lines changed

13 files changed

+56
-56
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ mdout支持你自定义页面边距,以英寸为单位,默认为0.4英寸
476476
有一个`conf.coml`文件,如果没有则说明没有进行上文的初始化下载,该配置文件除了像上文那样指定链接下载,也可以手动创建。
477477
478478
```json
479-
[Parmas]
479+
[Params]
480480
# 指定使用的主题名称
481481
ThemeName = "github"
482482

asserts/config/conf.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[Parmas]
1+
[Params]
22
# 指定使用的主题名称
33
ThemeName = "github"
44

@@ -27,7 +27,7 @@ Verbose = false
2727
# 使用 Sublime(在我电脑上的绝对路径,注意替换为自己电脑上的)
2828
# EditorPath = "E:\\Sublime Text 3\\sublime_text.exe"
2929
EditorPath = "code"
30-
EditorParmas = []
30+
EditorParams = []
3131

3232
# 设置输出日志等级,可选列表
3333
# "debug", "info", "error"

cmd/config.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ func getConfigCmd() *cobra.Command {
2222

2323
func configRunE(cmd *cobra.Command, args []string) error {
2424
runtime := config.Obj.Runtime
25-
parmas := append([]string{static.ConfigFileFullName}, (runtime.EditorParmas)...)
25+
params := append([]string{static.ConfigFileFullName}, (runtime.EditorParams)...)
2626

27-
execCmd := exec.Command(runtime.EditorPath, parmas...)
27+
execCmd := exec.Command(runtime.EditorPath, params...)
2828
// 获取输出对象,可以从该对象中读取输出结果
2929
stdout, err := execCmd.StdoutPipe()
3030
if err != nil {

cmd/install.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99
"github.com/spf13/cobra"
1010
)
1111

12-
var installParmas = struct {
12+
var installParams = struct {
1313
URL string
1414
}{}
1515

cmd/root.go

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import (
1717

1818
var (
1919
// 命令行输入参数,与cobra命令行绑定
20-
cmdParmas model.Parmas
20+
cmdParams model.Params
2121
// 根命令
2222
rootCmd = &cobra.Command{
2323
Use: "mdout",
@@ -56,7 +56,7 @@ func rootRunE(cmd *cobra.Command, args []string) error {
5656
// 输出调试参数
5757
showParams()
5858
// 构建请求
59-
req, err := requester.NewRequest(args[0], cmdParmas)
59+
req, err := requester.NewRequest(args[0], cmdParams)
6060
if err != nil {
6161
return err
6262
}
@@ -78,7 +78,7 @@ func rootRunE(cmd *cobra.Command, args []string) error {
7878
}
7979

8080
func setRuntimeLoggerLevel() {
81-
if cmdParmas.Verbose {
81+
if cmdParams.Verbose {
8282
level, _ := tool.TransformToLogrusLevel("debug")
8383
log.SetStdoutLevel(level)
8484
}
@@ -99,17 +99,17 @@ func setConfigLoggerLevel() {
9999

100100
func initRootCmdFlags() {
101101
rootFlags := rootCmd.Flags()
102-
confParmas := config.Obj.Parmas
102+
confParams := config.Obj.Params
103103

104104
// 添加Flags:变量 长名 短名 默认值 帮助说明
105-
rootFlags.StringVarP(&cmdParmas.OutPath, "out", "o", confParmas.OutPath, "文件输出的路径")
106-
rootFlags.StringVarP(&cmdParmas.OutType, "type", "t", confParmas.OutType, "输出的文件类型:tag、html、pdf")
107-
rootFlags.StringVarP(&cmdParmas.ThemeName, "theme", "e", confParmas.ThemeName, "界面的主题,可放入自定义主题包后修改")
108-
rootFlags.StringVarP(&cmdParmas.PageFormat, "format", "f", confParmas.PageFormat, "打印的页面格式:A5-A1、Legal、Letter、Tabloid")
109-
rootFlags.StringVarP(&cmdParmas.PageOrientation, "orientation", "r", confParmas.PageOrientation, "打印的页面方向,可选portrait(纵向)、landscape(横向)")
110-
rootFlags.StringVarP(&cmdParmas.PageMargin, "margin", "m", confParmas.PageMargin, "打印的页面边距大小,以英寸为单位")
111-
rootFlags.StringVarP(&cmdParmas.ExecPath, "exec-path", "p", confParmas.ExecPath, "Chrome的执行路径")
112-
rootFlags.BoolVarP(&cmdParmas.Verbose, "verbose", "v", false, "控制台输出详细日志")
105+
rootFlags.StringVarP(&cmdParams.OutPath, "out", "o", confParams.OutPath, "文件输出的路径")
106+
rootFlags.StringVarP(&cmdParams.OutType, "type", "t", confParams.OutType, "输出的文件类型:tag、html、pdf")
107+
rootFlags.StringVarP(&cmdParams.ThemeName, "theme", "e", confParams.ThemeName, "界面的主题,可放入自定义主题包后修改")
108+
rootFlags.StringVarP(&cmdParams.PageFormat, "format", "f", confParams.PageFormat, "打印的页面格式:A5-A1、Legal、Letter、Tabloid")
109+
rootFlags.StringVarP(&cmdParams.PageOrientation, "orientation", "r", confParams.PageOrientation, "打印的页面方向,可选portrait(纵向)、landscape(横向)")
110+
rootFlags.StringVarP(&cmdParams.PageMargin, "margin", "m", confParams.PageMargin, "打印的页面边距大小,以英寸为单位")
111+
rootFlags.StringVarP(&cmdParams.ExecPath, "exec-path", "p", confParams.ExecPath, "Chrome的执行路径")
112+
rootFlags.BoolVarP(&cmdParams.Verbose, "verbose", "v", false, "控制台输出详细日志")
113113
}
114114

115115
func addCmdToRoot() {
@@ -120,12 +120,12 @@ func addCmdToRoot() {
120120
// 输出参数信息调试
121121
func showParams() {
122122
log.Debugf("---这是你的合计输入参数---")
123-
log.Debugf("输出路径:%s\n", cmdParmas.OutPath)
124-
log.Debugf("输出格式:%s\n", cmdParmas.OutType)
125-
log.Debugf("选择主题:%s\n", cmdParmas.ThemeName)
126-
log.Debugf("打印页面格式:%s\n", cmdParmas.PageFormat)
127-
log.Debugf("打印页面方向:%s\n", cmdParmas.PageOrientation)
128-
log.Debugf("打印页面边距:%s\n", cmdParmas.PageMargin)
129-
log.Debugf("Chrome的执行路径:%s\n", cmdParmas.ExecPath)
123+
log.Debugf("输出路径:%s\n", cmdParams.OutPath)
124+
log.Debugf("输出格式:%s\n", cmdParams.OutType)
125+
log.Debugf("选择主题:%s\n", cmdParams.ThemeName)
126+
log.Debugf("打印页面格式:%s\n", cmdParams.PageFormat)
127+
log.Debugf("打印页面方向:%s\n", cmdParams.PageOrientation)
128+
log.Debugf("打印页面边距:%s\n", cmdParams.PageMargin)
129+
log.Debugf("Chrome的执行路径:%s\n", cmdParams.ExecPath)
130130
log.Debugf("--------------------------")
131131
}

config/init.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ import (
1111
)
1212

1313
func initConfigByDefault() {
14-
Obj.Parmas.OutType = "pdf"
15-
Obj.Parmas.ThemeName = "github"
16-
Obj.Parmas.PageFormat = "a4"
17-
Obj.Parmas.PageOrientation = "portrait"
18-
Obj.Parmas.PageMargin = "0.4"
14+
Obj.Params.OutType = "pdf"
15+
Obj.Params.ThemeName = "github"
16+
Obj.Params.PageFormat = "a4"
17+
Obj.Params.PageOrientation = "portrait"
18+
Obj.Params.PageMargin = "0.4"
1919

2020
Obj.Runtime.EditorPath = "code"
2121
Obj.Runtime.StdoutLogLevel = "debug"

model/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ package model
22

33
// Config 配置文件对应实体
44
type Config struct {
5-
Parmas Parmas
5+
Params Params
66
Runtime Runtime
77
}

model/parmas.go renamed to model/params.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
package model
22

3-
// Parmas 可供用户在命令行设置的参数
4-
type Parmas struct {
3+
// Params 可供用户在命令行设置的参数
4+
type Params struct {
55
// 输入输出参数
6-
IOParmas
6+
IOParams
77
// 打印页面参数
8-
PageParmas
8+
PageParams
99
// 主题
1010
ThemeName string
1111
// 指定 Chrome 程序执行路径
@@ -14,16 +14,16 @@ type Parmas struct {
1414
Verbose bool
1515
}
1616

17-
// IOParmas 输入输出参数
18-
type IOParmas struct {
17+
// IOParams 输入输出参数
18+
type IOParams struct {
1919
// 文件输出路径
2020
OutPath string
2121
// 目标文件类型
2222
OutType string
2323
}
2424

25-
// PageParmas 打印页面参数
26-
type PageParmas struct {
25+
// PageParams 打印页面参数
26+
type PageParams struct {
2727
// 打印页面格式
2828
PageFormat string
2929
// 打印页面方向

model/runtime.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ type EditorRuntime struct {
1212
// 打开配置文件的编辑器命令
1313
EditorPath string
1414
// 打开配置文件的编辑器参数
15-
EditorParmas []string
15+
EditorParams []string
1616
}
1717

1818
// LogRuntime 日志参数

requester/file.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99
"github.com/JabinGP/mdout/tool"
1010
)
1111

12-
func buildFileReq(inPath string, parmas model.Parmas) (*Request, error) {
12+
func buildFileReq(inPath string, params model.Params) (*Request, error) {
1313
// 获取输入文件类型
1414
inExt := filepath.Ext(filepath.Base(inPath))
1515
inType := strings.ReplaceAll(inExt, ".", "")
@@ -24,7 +24,7 @@ func buildFileReq(inPath string, parmas model.Parmas) (*Request, error) {
2424
if err != nil {
2525
return nil, err
2626
}
27-
absOutPath, err := tool.GetOutFullName(inPath, parmas)
27+
absOutPath, err := tool.GetOutFullName(inPath, params)
2828
if err != nil {
2929
return nil, err
3030
}
@@ -35,7 +35,7 @@ func buildFileReq(inPath string, parmas model.Parmas) (*Request, error) {
3535
}
3636

3737
req := &Request{
38-
Parmas: parmas,
38+
Params: params,
3939
InPath: inPath,
4040
AbsInPath: absInPath,
4141
AbsOutPath: absOutPath,

0 commit comments

Comments
 (0)