Only run default command if no args

Add custom template (Frameworks)
This commit is contained in:
Lea Anthony
2018-12-26 19:09:18 +11:00
parent 859b2dd638
commit 53cf2bb953
20 changed files with 248 additions and 2 deletions

View File

@@ -172,7 +172,10 @@ func (c *Command) Run(args []string) error {
if c.App.defaultCommand != nil {
// Prevent recursion!
if c.App.defaultCommand != c {
return c.App.defaultCommand.Run(args)
// only run default command if no args passed
if len(args) == 0 {
return c.App.defaultCommand.Run(args)
}
}
}