diff options
Diffstat (limited to 'libbe/ui/command_line.py')
-rw-r--r-- | libbe/ui/command_line.py | 5 |
1 files changed, 3 insertions, 2 deletions
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: |