Skip to content

Commit

Permalink
Fix subcommand assignment in Crispy class
Browse files Browse the repository at this point in the history
Signed-off-by: Ferit Yiğit BALABAN <fyb@fybx.dev>
  • Loading branch information
fybx committed Dec 16, 2023
1 parent c850bcc commit cae45f1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crispy/crispy.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def parse_arguments(self, args: List[str]) -> Tuple[str, Dict[str, Union[str, bo
if not args:
raise NoArgumentsException("crispy: no argument was given!")

subcommand: str = None
subcommand: str = ""
keys: Dict[str, Union[str, bool, int, float]] = {}
i, len_args = 0, len(args)
while i < len_args:
Expand All @@ -116,7 +116,7 @@ def parse_arguments(self, args: List[str]) -> Tuple[str, Dict[str, Union[str, bo
continue

if not key.startswith("-"):
if subcommand:
if subcommand != "":
raise TooManySubcommandsException(f"crispy: too many subcommands! '{key}' is unexpected!")
subcommand = key
i += 1
Expand Down

0 comments on commit cae45f1

Please sign in to comment.