better command help
This commit is contained in:
parent
4012f24235
commit
0f08f16a5f
|
@ -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)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user