diff options
-rw-r--r-- | .be/bea86499-824e-4e77-b085-2d581fa9ccab/bugs/bc1e6ff4-478f-4afe-b2a1-86e25ee448b7/values | 2 | ||||
-rw-r--r-- | libbe/ui/command_line.py | 5 |
2 files changed, 4 insertions, 3 deletions
diff --git a/.be/bea86499-824e-4e77-b085-2d581fa9ccab/bugs/bc1e6ff4-478f-4afe-b2a1-86e25ee448b7/values b/.be/bea86499-824e-4e77-b085-2d581fa9ccab/bugs/bc1e6ff4-478f-4afe-b2a1-86e25ee448b7/values index 71ed832..d06c54c 100644 --- a/.be/bea86499-824e-4e77-b085-2d581fa9ccab/bugs/bc1e6ff4-478f-4afe-b2a1-86e25ee448b7/values +++ b/.be/bea86499-824e-4e77-b085-2d581fa9ccab/bugs/bc1e6ff4-478f-4afe-b2a1-86e25ee448b7/values @@ -7,7 +7,7 @@ reporter: Tanguy LE CARROUR <tanguy.lecarrour@gmail.com> severity: minor -status: open +status: fixed summary: Crashes when too many arguments are provided diff --git a/libbe/ui/command_line.py b/libbe/ui/command_line.py index d5719a6..f579a19 100644 --- a/libbe/ui/command_line.py +++ b/libbe/ui/command_line.py @@ -133,8 +133,9 @@ class CmdOptionParser(optparse.OptionParser): else: value = self.process_raw_argument(argument=argument, value=arg) parsed_args[i] = value - if len(parsed_args) > len(self.command.args) \ - and self.command.args[-1].repeatable == False: + if (len(parsed_args) > len(self.command.args) and + (len(self.command.args) == 0 or + self.command.args[-1].repeatable == False)): raise libbe.command.UserError('Too many arguments') for arg in self.command.args[len(parsed_args):]: if arg.optional == False: |