decorators: fix the case where there is no argument
can’t believe we didn’t hit that before
This commit is contained in:
parent
7946190019
commit
a6c4db6c2f
1 changed files with 4 additions and 1 deletions
|
@ -118,7 +118,10 @@ class CommandArgParser(object):
|
||||||
def first(func):
|
def first(func):
|
||||||
def second(self, args, *a, **kw):
|
def second(self, args, *a, **kw):
|
||||||
default_args = defaults
|
default_args = defaults
|
||||||
args = common.shell_split(args)
|
if args and args.strip():
|
||||||
|
args = common.shell_split(args)
|
||||||
|
else:
|
||||||
|
args = []
|
||||||
if len(args) < mandatory:
|
if len(args) < mandatory:
|
||||||
return func(self, None, *a, **kw)
|
return func(self, None, *a, **kw)
|
||||||
res, args = args[:mandatory], args[mandatory:]
|
res, args = args[:mandatory], args[mandatory:]
|
||||||
|
|
Loading…
Reference in a new issue