mirror of
https://github.com/openSUSE/osc.git
synced 2025-01-24 22:06:14 +01:00
cmdln: Sort commands before printing help
This commit is contained in:
parent
f7c84d42a3
commit
e0404c003b
@ -81,7 +81,9 @@ class HelpFormatter(argparse.RawDescriptionHelpFormatter):
|
||||
def _format_action(self, action):
|
||||
if isinstance(action, argparse._SubParsersAction):
|
||||
parts = []
|
||||
for i in action._get_subactions():
|
||||
subactions = action._get_subactions()
|
||||
subactions.sort(key=lambda x: x.metavar)
|
||||
for i in subactions:
|
||||
if i.help == argparse.SUPPRESS:
|
||||
# don't display commands with suppressed help
|
||||
continue
|
||||
|
Loading…
Reference in New Issue
Block a user