Group commands by topic in “pysetup run --list-commands” output.

This fixes a regression from distutils, where “setup.py --help-commands”
prints out commands grouped by topic (i.e. building vs. installing),
which is more useful than using sorted.
This commit is contained in:
Éric Araujo 2012-02-09 14:29:11 +01:00
parent 1aa54a417d
commit 5c69b66086
3 changed files with 39 additions and 35 deletions

View file

@ -254,16 +254,13 @@ def _run(dispatcher, args, **kw):
parser = dispatcher.parser
args = args[1:]
commands = STANDARD_COMMANDS # + extra commands
commands = STANDARD_COMMANDS # FIXME display extra commands
if args == ['--list-commands']:
print('List of available commands:')
cmds = sorted(commands)
for cmd in cmds:
for cmd in commands:
cls = dispatcher.cmdclass.get(cmd) or get_command_class(cmd)
desc = getattr(cls, 'description',
'(no description available)')
desc = getattr(cls, 'description', '(no description available)')
print(' %s: %s' % (cmd, desc))
return