mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
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:
parent
1aa54a417d
commit
5c69b66086
3 changed files with 39 additions and 35 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue