feat: use urfave/cli DefaultText

main
hau 2020-12-18 16:21:59 +07:00
parent 0f47650484
commit 05c878d795
1 changed files with 15 additions and 10 deletions

25
main.go
View File

@ -64,24 +64,29 @@ func main() {
Usage: "generate to `COMMIT` (include that commit)",
},
&cli.StringFlag{
Name: versionFlag,
Usage: fmt.Sprintf("`VERSION` to generate, follow Semantic Versioning, example 1.0.0 (default is %s)", defaultVersion),
Name: versionFlag,
Usage: "`VERSION` to generate, follow Semantic Versioning, example 1.0.0",
DefaultText: defaultVersion,
},
&cli.StringFlag{
Name: repositoryFlag,
Usage: fmt.Sprintf("`REPOSITORY` path, example /go/src/myapp (default is %s)", defaultRepositry),
Name: repositoryFlag,
Usage: "`REPOSITORY` path, example /go/src/myapp",
DefaultText: defaultRepositry,
},
&cli.StringFlag{
Name: outputDirFlag,
Usage: fmt.Sprintf("`OUTPUT_DIR` path, example /go/src/myapp (default is %s)", defaultOutputDir),
Name: outputDirFlag,
Usage: "`OUTPUT_DIR` path, example /go/src/myapp",
DefaultText: defaultOutputDir,
},
&cli.StringFlag{
Name: filenameFlag,
Usage: fmt.Sprintf("output `FILENAME` (default is %s)", defaultFilename),
Name: filenameFlag,
Usage: "output `FILENAME`",
DefaultText: defaultFilename,
},
&cli.StringFlag{
Name: filetypeFlag,
Usage: fmt.Sprintf("output `FILETYPE` support md (markdown) (default is %s)", defaultFiletype),
Name: filetypeFlag,
Usage: "output `FILETYPE` support md (markdown)",
DefaultText: defaultFiletype,
},
&cli.BoolFlag{
Name: verboseFlag,