From: Ian Weller Date: Sat, 13 Mar 2010 00:50:14 +0000 (-0600) Subject: Alphabetize command listing on --help X-Git-Url: https://projects.mako.cc/source/mw/commitdiff_plain/19cab7e9c748f20a3fc0120b98ca20abca6236e0?ds=inline Alphabetize command listing on --help --- diff --git a/src/mw/cli.py b/src/mw/cli.py index ef33d73..52df23b 100644 --- a/src/mw/cli.py +++ b/src/mw/cli.py @@ -45,7 +45,9 @@ class CLI(object): def usage(self): print 'usage: %s [subcommand]' % self.me print - for name in self.commands: + commands = self.commands.keys() + commands.sort() + for name in commands: cmd = self.commands[name] if len(cmd.shortcuts) > 0: full = name + ' (' + ' '.join(cmd.shortcuts) + ')'