Skip to content

Commit

Permalink
sorts the commands and subcommands
Browse files Browse the repository at this point in the history
  • Loading branch information
albireox authored and stephenfin committed May 31, 2017
1 parent 2b0c700 commit bc45d8f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sphinx_click/ext.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ def _format_command(ctx, show_nested):
if show_nested:
return

commands = getattr(ctx.command, 'commands', {}).items()
commands = sorted(getattr(ctx.command, 'commands', {}).items())

if commands:
yield '.. rubric:: Commands'
Expand Down Expand Up @@ -261,7 +261,7 @@ def _generate_nodes(self, name, command, parent=None, show_nested=False):

if show_nested:
commands = getattr(ctx.command, 'commands', {})
for command_name, command_obj in commands.items():
for command_name, command_obj in sorted(commands.items()):
section.extend(self._generate_nodes(
command_name,
command_obj,
Expand Down

0 comments on commit bc45d8f

Please sign in to comment.