SpecArgumentTypeString should return None when no args
This commit is contained in:
parent
005334e2be
commit
c1543ed899
1 changed files with 3 additions and 1 deletions
|
@ -44,7 +44,9 @@ class SpecArgumentTypeString(SpecArgumentType):
|
||||||
def name(self):
|
def name(self):
|
||||||
return "%s ..." % SpecArgumentType.name(self)
|
return "%s ..." % SpecArgumentType.name(self)
|
||||||
def simple(self, args: typing.List[str]) -> typing.Tuple[typing.Any, int]:
|
def simple(self, args: typing.List[str]) -> typing.Tuple[typing.Any, int]:
|
||||||
return " ".join(args), len(args)
|
if args:
|
||||||
|
return " ".join(args), len(args)
|
||||||
|
return None, 1
|
||||||
class SpecArgumentTypeTrimString(SpecArgumentTypeString):
|
class SpecArgumentTypeTrimString(SpecArgumentTypeString):
|
||||||
def simple(self, args: typing.List[str]):
|
def simple(self, args: typing.List[str]):
|
||||||
return SpecArgumentTypeString.simple(self, list(filter(None, args)))
|
return SpecArgumentTypeString.simple(self, list(filter(None, args)))
|
||||||
|
|
Loading…
Reference in a new issue