From 864c8349d5fa94e58bca764c2dfe97ae4ba8cc7d Mon Sep 17 00:00:00 2001 From: Ajitem Sahasrabuddhe Date: Thu, 28 Nov 2019 12:16:24 +0530 Subject: [PATCH 1/3] Hide version info if user has not defined version --- app.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app.go b/app.go index d03ec5d..5e5c856 100644 --- a/app.go +++ b/app.go @@ -110,7 +110,6 @@ func NewApp() *App { HelpName: filepath.Base(os.Args[0]), Usage: "A new cli application", UsageText: "", - Version: "0.0.0", BashComplete: DefaultAppComplete, Action: helpCommand.Action, Compiled: compileTime(), @@ -141,7 +140,7 @@ func (a *App) Setup() { } if a.Version == "" { - a.Version = "0.0.0" + a.HideVersion = true } if a.BashComplete == nil { From 6515054c1dd617d54216843c1a1ac21bc51b7e6f Mon Sep 17 00:00:00 2001 From: Ajitem Sahasrabuddhe Date: Thu, 28 Nov 2019 12:31:14 +0530 Subject: [PATCH 2/3] Update Manual --- docs/v2/manual.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/docs/v2/manual.md b/docs/v2/manual.md index f7898e7..5e04d4e 100644 --- a/docs/v2/manual.md +++ b/docs/v2/manual.md @@ -154,14 +154,11 @@ NAME: USAGE: greet [global options] command [command options] [arguments...] -VERSION: - 0.0.0 - COMMANDS: help, h Shows a list of commands or help for one command GLOBAL OPTIONS - --version Shows version information + --help, -h show help (default: false) ``` ### Arguments From cda3a4900ed32421f3cafd4e3463cc2ba726ff94 Mon Sep 17 00:00:00 2001 From: Ajitem Sahasrabuddhe Date: Thu, 28 Nov 2019 12:31:30 +0530 Subject: [PATCH 3/3] Fix failing test --- app_test.go | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/app_test.go b/app_test.go index 9d33745..bb0edb6 100644 --- a/app_test.go +++ b/app_test.go @@ -192,15 +192,11 @@ func ExampleApp_Run_noAction() { // USAGE: // greet [global options] command [command options] [arguments...] // - // VERSION: - // 0.0.0 - // // COMMANDS: // help, h Shows a list of commands or help for one command // // GLOBAL OPTIONS: - // --help, -h show help (default: false) - // --version, -v print the version (default: false) + // --help, -h show help (default: false) } func ExampleApp_Run_subcommandNoAction() { @@ -256,8 +252,6 @@ func ExampleApp_Run_bashComplete_withShortFlag() { // -x // --help // -h - // --version - // -v } func ExampleApp_Run_bashComplete_withLongFlag() {