replace default --help processor with one that includes the list of subcommands available

This commit is contained in:
Doug Hellmann
2012-04-20 22:20:17 -07:00
parent e5c6c4c918
commit 417c4f7bac
3 changed files with 24 additions and 0 deletions

View File

@@ -24,6 +24,9 @@ class CommandManager(object):
self.commands[ep.name.replace('_', ' ')] = ep
return
def __iter__(self):
return iter(self.commands.items())
def find_command(self, argv):
"""Given an argument list, find a command and
return the processor and any remaining arguments.