fix tests
This commit is contained in:
10
command.go
10
command.go
@@ -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)
|
||||
}
|
||||
|
Reference in New Issue
Block a user