mirror of
https://github.com/ipfs/kubo.git
synced 2026-03-02 23:08:07 +08:00
commands/cli: Error if no subcommand matched
This commit is contained in:
parent
83b2ba00e9
commit
30e968754e
@ -1,6 +1,7 @@
|
||||
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)
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user