Commit 538c0487 authored by Matt Bell's avatar Matt Bell Committed by Juan Batiz-Benet

commands/cli: Error if no subcommand matched

parent 8af6e437
package cli
import (
"errors"
"fmt"
"strings"
......@@ -30,6 +31,10 @@ func Parse(input []string, roots ...*cmds.Command) (cmds.Request, *cmds.Command,
}
}
if maxLength == 0 {
return nil, nil, errors.New("Not a valid subcommand")
}
// TODO: figure out how to know when to read given file(s) as an input stream
// (instead of filename arg string)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment