From 05c878d7952cfa1b02f024c45db92f466584dfeb Mon Sep 17 00:00:00 2001 From: hau Date: Fri, 18 Dec 2020 16:21:59 +0700 Subject: [PATCH] feat: use urfave/cli DefaultText --- main.go | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/main.go b/main.go index b18cb99..d21132e 100644 --- a/main.go +++ b/main.go @@ -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,