-C throws KeyError if handed an invalid command

Bug #347128 reported by Paul Jimenez
2
Affects Status Importance Assigned to Milestone
Vellum
Fix Committed
Undecided
Unassigned

Bug Description

'vellum -C foobies' throws KeyError and traces back.

This gives an error instead, but should probably give a better error message (listing available commands maybe?):

=== modified file 'vellum/bin.py'
--- vellum/bin.py 2008-04-29 06:49:09 +0000
+++ vellum/bin.py 2009-03-23 05:32:55 +0000
@@ -88,8 +88,11 @@
     """
     to_search = args or script.commands.keys()
     for cmd in to_search:
- func = script.commands[cmd]
- doc = func.__doc__ if func.__doc__ else "\n Undocumented"
+ if cmd in script.commands:
+ func = script.commands[cmd]
+ doc = func.__doc__ if func.__doc__ else "\n Undocumented"
+ else:
+ doc = "\n Invalid command"
         print "%s:%s" % (cmd, doc)

 def shell(options, script, user_input=raw_input):

Ali Afshar (aafshar)
Changed in vellum:
status: New → Confirmed
Ali Afshar (aafshar)
Changed in vellum:
status: Confirmed → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.