Skip to content
Snippets Groups Projects
Commit 86d0ad3c authored by red-agent's avatar red-agent
Browse files

Fix for the command argument constraints

parent ad0bb437
No related branches found
No related tags found
No related merge requests found
......@@ -270,6 +270,16 @@ def adapt_arguments(command, arguments, args, opts):
if value not in initial:
raise CommandError("%s: Invalid argument" % key, command)
# If argument to an option constrained by a sequence was not given - then
# it's value should be set to None.
for spec_key, spec_value in spec_kwargs:
if isinstance(spec_value, (TupleType, ListType)):
for key, value in opts:
if spec_key == key:
break
else:
opts.append((spec_key, None))
# We need to encode every keyword argument to a simple string, not the
# unicode one, because ** expansion does not support it.
for index, (key, value) in enumerate(opts):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment