fix tests

This commit is contained in:
Tristan Zajonc
2015-08-12 21:43:14 -07:00
parent ecb0b5ac0a
commit aced6e8739
4 changed files with 29 additions and 17 deletions

View File

@@ -39,9 +39,8 @@ type Command struct {
// Boolean to hide built-in help command
HideHelp bool
// Name of parent command for help, defaults to app.Name and parent
// command.Name.
ParentName string
// Name of command for help, defaults to full command name
HelpName string
commandNamePath []string
}
@@ -158,14 +157,12 @@ func (c Command) startApp(ctx *Context) error {
// set the name and usage
app.Name = fmt.Sprintf("%s %s", ctx.App.Name, c.Name)
app.HelpName = fmt.Sprintf("%s %s", ctx.App.Name, c.Name)
if c.Description != "" {
app.Usage = c.Description
} else {
app.Usage = c.Usage
}
if c.ArgsUsage == "" {
c.ArgsUsage = "[arguments...]"
}
// set CommandNotFound
app.CommandNotFound = ctx.App.CommandNotFound
@@ -199,7 +196,6 @@ func (c Command) startApp(ctx *Context) error {
var newCmds []Command
for _, cc := range app.Commands {
cc.ParentName = app.Name
cc.commandNamePath = []string{c.Name, cc.Name}
newCmds = append(newCmds, cc)
}