-C throws KeyError if handed an invalid command
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.
for cmd in to_search:
- func = script.
- doc = func.__doc__ if func.__doc__ else "\n Undocumented"
+ if cmd in script.commands:
+ func = script.
+ 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=
Changed in vellum: | |
status: | New → Confirmed |
Changed in vellum: | |
status: | Confirmed → Fix Committed |