Custom type for arguments

This commit is contained in:
Alexander Rødseth
2013-11-24 14:40:21 +01:00
parent fbbda7a902
commit 1bea6dcbf0
6 changed files with 40 additions and 23 deletions

View File

@@ -76,8 +76,8 @@ var helpCommand = Command{
Usage: "Shows a list of commands or help for one command",
Action: func(c *Context) {
args := c.Args()
if len(args) > 0 {
ShowCommandHelp(c, args[0])
if args.Present() {
ShowCommandHelp(c, args.First())
} else {
ShowAppHelp(c)
}