Fix:(issue_1548) Check root before run default cmd
This commit is contained in:
@@ -252,7 +252,7 @@ func (c *Command) Run(cCtx *Context, arguments ...string) (err error) {
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if cCtx.App.DefaultCommand != "" {
|
||||
} else if c.isRoot && cCtx.App.DefaultCommand != "" {
|
||||
if dc := cCtx.App.Command(cCtx.App.DefaultCommand); dc != c {
|
||||
cmd = dc
|
||||
}
|
||||
|
Reference in New Issue
Block a user