diff --git a/sphinx_click/ext.py b/sphinx_click/ext.py index a6ec3f5..aef238c 100644 --- a/sphinx_click/ext.py +++ b/sphinx_click/ext.py @@ -519,12 +519,16 @@ def _generate_nodes( ) ) else: - commands = _filter_commands(ctx, commands) - for command in commands: + command_objs = _filter_commands(ctx, commands) + for command in command_objs: parent = ctx if not semantic_group else ctx.parent section.extend( self._generate_nodes( - command.name, command, parent=parent, nested=nested + command.name, + command, + parent=parent, + nested=nested, + commands=commands, ) )