better command help

This commit is contained in:
gutmet 2018-12-09 23:57:43 +01:00
parent 4012f24235
commit 0f08f16a5f

View File

@ -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)
}