Skip to content

Commit 31feb9a

Browse files
committed
fix: too many arguments error text
This doesn't mean we've picked the wrong command, we shouldn't try suggesting one. fixes ipfs/kubo#6514
1 parent f6f6a65 commit 31feb9a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cli/parse.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ func parseArgs(req *cmds.Request, root *cmds.Command, stdin *os.File) error {
205205
// and the last arg definition is not variadic (or there are no definitions), return an error
206206
notVariadic := len(argDefs) == 0 || !argDefs[len(argDefs)-1].Variadic
207207
if notVariadic && len(inputs) > len(argDefs) {
208-
return printSuggestions(inputs, root)
208+
return fmt.Errorf("expected %d argument(s), got %d", len(argDefs), len(inputs))
209209
}
210210

211211
stringArgs := make([]string, 0, numInputs)

0 commit comments

Comments
 (0)