use root if no other command matches and root is runnable

This commit is contained in:
Viktor Benei 2016-07-04 21:24:58 +02:00
parent 6a8bd97bdb
commit 45b377d6b1

View file

@ -436,7 +436,7 @@ func (c *Command) Find(args []string) (*Command, []string, error) {
}
// root command with subcommands, do subcommand checking
if commandFound == c && len(argsWOflags) > 0 {
if commandFound == c && !c.Runnable() && len(argsWOflags) > 0 {
suggestionsString := ""
if !c.DisableSuggestions {
if c.SuggestionsMinimumDistance <= 0 {