move to CommandNotFound copy to startApp
This commit is contained in:
parent
1880853f15
commit
156cd267e5
3
app.go
3
app.go
@ -151,9 +151,6 @@ func (a *App) RunAsSubcommand(ctx *Context) error {
|
||||
}
|
||||
}
|
||||
|
||||
// add the App's CommandNotFound
|
||||
a.CommandNotFound = ctx.App.CommandNotFound
|
||||
|
||||
// append flags
|
||||
if a.EnableBashCompletion {
|
||||
a.appendFlag(BashCompletionFlag)
|
||||
|
@ -118,6 +118,9 @@ func (c Command) startApp(ctx *Context) error {
|
||||
app.Usage = c.Usage
|
||||
}
|
||||
|
||||
// set CommandNotFound
|
||||
app.CommandNotFound = ctx.App.CommandNotFound
|
||||
|
||||
// set the flags and commands
|
||||
app.Commands = c.Subcommands
|
||||
app.Flags = c.Flags
|
||||
|
Loading…
Reference in New Issue
Block a user