From: Ian Weller Date: Fri, 18 Dec 2009 16:51:16 +0000 (-0600) Subject: Fix usage() from duplicating shortcuts as commands X-Git-Url: https://projects.mako.cc/source/mw/commitdiff_plain/b44fba0c01de2db1c61a1902ca488f497c0aa90c?ds=sidebyside;hp=768bad65409c069fdc2b7bf94d07a2ad34e0a00d Fix usage() from duplicating shortcuts as commands --- diff --git a/src/mw/cli.py b/src/mw/cli.py index e1d96c0..a822ff2 100644 --- a/src/mw/cli.py +++ b/src/mw/cli.py @@ -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]