Switch from multi-return with exit codes to ExitCoder check

This commit is contained in:
Dan Buch
2016-04-27 09:12:34 -04:00
parent b40b62794d
commit b7329f4968
11 changed files with 291 additions and 243 deletions

View File

@@ -78,14 +78,14 @@ var helpCommand = Command{
Aliases: []string{"h"},
Usage: "Shows a list of commands or help for one command",
ArgsUsage: "[command]",
Action: func(c *Context) int {
Action: func(c *Context) error {
args := c.Args()
if args.Present() {
ShowCommandHelp(c, args.First())
} else {
ShowAppHelp(c)
}
return 0
return nil
},
}
@@ -94,14 +94,14 @@ var helpSubcommand = Command{
Aliases: []string{"h"},
Usage: "Shows a list of commands or help for one command",
ArgsUsage: "[command]",
Action: func(c *Context) int {
Action: func(c *Context) error {
args := c.Args()
if args.Present() {
ShowCommandHelp(c, args.First())
} else {
ShowSubcommandHelp(c)
}
return 0
return nil
},
}