Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calling help on an invalid command generates an exception #1

Open
garside opened this issue Oct 5, 2010 · 0 comments
Open

Calling help on an invalid command generates an exception #1

garside opened this issue Oct 5, 2010 · 0 comments

Comments

@garside
Copy link

garside commented Oct 5, 2010

When you call " help some_undefined_command", it throws a KeyError. I've found a work around from another part of the code. The patch I'm using is:

--- subcommand.py 2010-10-05 19:14:23.000000000 -0400
+++ other.py 2010-10-05 19:15:27.000000000 -0400
@@ -209,7 +209,11 @@
"""
if cmds:
for cmd in cmds:

  •       subcommand_lookup[cmd].showhelp()
    
  •       if cmd in subcommand_lookup:
    
  •           subcommand_lookup[cmd].showhelp()
    
  •       else:
    
  •           print >> sys.stderr, "Unknown command:", cmd
    
  •           print >> sys.stderr, "Type '%s help' for usage." % prog.name
    
    else:
    print "usage: %s [options] [args]" % prog.name
    print
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant