From cae45f15297c39593be3301504e26cd65ac1a374 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ferit=20Yi=C4=9Fit=20BALABAN?= Date: Sat, 16 Dec 2023 22:07:40 +0300 Subject: [PATCH] Fix subcommand assignment in Crispy class MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Ferit Yiğit BALABAN --- crispy/crispy.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crispy/crispy.py b/crispy/crispy.py index 3de229c..260f18f 100644 --- a/crispy/crispy.py +++ b/crispy/crispy.py @@ -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: @@ -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