Commit d4ac4428 authored by Matt Bell's avatar Matt Bell

commands/cli: Fixed Parse required argument check

parent ce49541f
......@@ -249,9 +249,11 @@ func parseArgs(inputs []string, stdin *os.File, argDefs []cmds.Argument, recursi
}
// check to make sure we didn't miss any required arguments
for _, argDef := range argDefs[argDefIndex:] {
if argDef.Required {
return nil, nil, fmt.Errorf("Argument '%s' is required", argDef.Name)
if len(argDefs) > argDefIndex {
for _, argDef := range argDefs[argDefIndex:] {
if argDef.Required {
return nil, nil, fmt.Errorf("Argument '%s' is required", argDef.Name)
}
}
}
......
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