add ArgsUsage to App and Command

This commit is contained in:
Tristan Zajonc
2015-08-03 16:51:11 -07:00
parent 142e6cd241
commit ef65245544
3 changed files with 19 additions and 9 deletions

View File

@@ -18,6 +18,8 @@ type Command struct {
Usage string
// A longer explanation of how the command works
Description string
// A short description of the arguments of this command
ArgsUsage string
// The function to call when checking for bash command completions
BashComplete func(context *Context)
// An action to execute before any sub-subcommands are run, but after the context is ready
@@ -158,6 +160,9 @@ func (c Command) startApp(ctx *Context) error {
} else {
app.Usage = c.Usage
}
if c.ArgsUsage == "" {
c.ArgsUsage = "[arguments...]"
}
// set CommandNotFound
app.CommandNotFound = ctx.App.CommandNotFound