Check if root cmd is runnable and run if it is

This commit is contained in:
h0tw4t3r 2019-10-05 21:44:29 +02:00
parent 3745fcd262
commit 9fc0d920d7
No known key found for this signature in database
GPG key ID: 3D975CE3DC25032E

View file

@ -892,7 +892,10 @@ func (c *Command) ExecuteC() (cmd *Command, err error) {
}
var flags []string
if c.TraverseChildren {
if c.Runnable() {
cmd = c
flags = args
} else if c.TraverseChildren {
cmd, flags, err = c.Traverse(args)
} else {
cmd, flags, err = c.Find(args)