From 0f08f16a5f7d606339c075a0d1cca19ad3d4b27a Mon Sep 17 00:00:00 2001 From: gutmet Date: Sun, 9 Dec 2018 23:57:43 +0100 Subject: [PATCH] better command help --- goutil.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/goutil.go b/goutil.go index 293d567..eee5b74 100644 --- a/goutil.go +++ b/goutil.go @@ -175,7 +175,8 @@ func NewCommand(cmd string, f CommandFunc, desc string) Command { type commandCollection map[string]Command func usageAndExit(cmds []Command) { - fmt.Println(os.Args[0]) + app := os.Args[0] + fmt.Println(app) fmt.Println() fmt.Println("Possible commands:") for _, cmd := range cmds { @@ -183,7 +184,7 @@ func usageAndExit(cmds []Command) { fmt.Println(" \t" + cmd.desc) } fmt.Println() - fmt.Println("for detailed information type 'help COMMAND'") + fmt.Println("for detailed information type '" + app + " help COMMAND'") os.Exit(-1) }