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
|
// append flags
|
||||||
if a.EnableBashCompletion {
|
if a.EnableBashCompletion {
|
||||||
a.appendFlag(BashCompletionFlag)
|
a.appendFlag(BashCompletionFlag)
|
||||||
|
@ -118,6 +118,9 @@ func (c Command) startApp(ctx *Context) error {
|
|||||||
app.Usage = c.Usage
|
app.Usage = c.Usage
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// set CommandNotFound
|
||||||
|
app.CommandNotFound = ctx.App.CommandNotFound
|
||||||
|
|
||||||
// set the flags and commands
|
// set the flags and commands
|
||||||
app.Commands = c.Subcommands
|
app.Commands = c.Subcommands
|
||||||
app.Flags = c.Flags
|
app.Flags = c.Flags
|
||||||
|
Loading…
Reference in New Issue
Block a user