]> projects.mako.cc - mw/commitdiff
Fix usage() from duplicating shortcuts as commands
authorIan Weller <ian@ianweller.org>
Fri, 18 Dec 2009 16:51:16 +0000 (10:51 -0600)
committerIan Weller <ian@ianweller.org>
Fri, 18 Dec 2009 16:51:16 +0000 (10:51 -0600)
src/mw/cli.py

index e1d96c0be19141ccc5f6d62b2b2b20c7cf3e9504..a822ff24c371eaa499f993c97e49725fa0ef7d73 100644 (file)
@@ -21,6 +21,7 @@ import inspect
 import mw.clicommands
 import os
 import sys
+from pprint import pprint
 
 class CLI(object):
     def __init__(self):
@@ -36,7 +37,8 @@ class CLI(object):
                 cmd = clazz()
                 self.commands[cmd.name] = cmd
                 self.shortcuts[cmd.name] = cmd.shortcuts
-        self.all_commands = self.commands
+        self.all_commands = {}
+        self.all_commands.update(self.commands)
         for command in self.shortcuts:
             for shortcut in self.shortcuts[command]:
                 self.all_commands[shortcut] = self.commands[command]

Benjamin Mako Hill || Want to submit a patch?