mirror of
https://github.com/RYGhub/royalnet.git
synced 2024-11-27 13:34:28 +00:00
Type .optional
This commit is contained in:
parent
d67110be09
commit
b22215a93b
1 changed files with 1 additions and 1 deletions
|
@ -55,7 +55,7 @@ class CommandArgs(list):
|
||||||
raise InvalidInputError("Invalid syntax.")
|
raise InvalidInputError("Invalid syntax.")
|
||||||
return match.groups()
|
return match.groups()
|
||||||
|
|
||||||
def optional(self, index: int, default=None):
|
def optional(self, index: int, default=None) -> typing.Optional[str]:
|
||||||
"""Get the argument at a specific index, but don't raise an error if nothing is found, instead returning the ``default`` value.
|
"""Get the argument at a specific index, but don't raise an error if nothing is found, instead returning the ``default`` value.
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
|
|
Loading…
Reference in a new issue