aboutsummaryrefslogtreecommitdiffstats
path: root/libbe
diff options
context:
space:
mode:
authorW. Trevor King <wking@drexel.edu>2011-09-07 23:24:18 -0400
committerW. Trevor King <wking@drexel.edu>2011-09-07 23:24:18 -0400
commite7da79e665798ddd411ab89134ec8c6cf9ff0e58 (patch)
tree1f49a8b91fd3d9bbc764b05da2d0801b1c40b7a1 /libbe
parent86a140aaf4b799ee78864c7a520ba9fde9fb3382 (diff)
downloadbugseverywhere-e7da79e665798ddd411ab89134ec8c6cf9ff0e58.tar.gz
Fixed #/bc1e6ff4# (extra argument crash).
Diffstat (limited to 'libbe')
-rw-r--r--libbe/ui/command_line.py5
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: