1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-05-20 16:36:46 +08:00

commands/cli: Fixed bug when parsing args for a command that doesn't have any argument definitions

This commit is contained in:
Matt Bell
2014-11-13 22:50:27 -08:00
committed by Juan Batiz-Benet
parent 1abe97617e
commit 9370740db0

View File

@ -154,7 +154,7 @@ func parseArgs(stringArgs []string, stdin *os.File, arguments []cmds.Argument) (
var argDef cmds.Argument
if argDefIndex < len(arguments) {
argDef = arguments[argDefIndex]
} else {
} else if len(arguments) > 0 {
argDef = arguments[len(arguments)-1]
}