Sort help output

Commands are now listed in sorted order. (With Python's hash randomization,
the order was changing on every execution!)
This commit is contained in:
Adrian Sampson 2014-07-17 09:58:07 -07:00
parent 3cf015606d
commit 36b26f77e7

View file

@ -724,6 +724,7 @@ class SubcommandsOptionParser(optparse.OptionParser):
disp_names = []
help_position = 0
subcommands = [c for c in self.subcommands if not c.hide]
subcommands.sort(key=lambda c: c.name)
for subcommand in subcommands:
name = subcommand.name
if subcommand.aliases: