When using Custom Multi Commands sphinx-click doesn't document the subcommands because multicommand.commands is empty
A quick solution on click's side would be to manually populate the commands attribute by loading all the commands but if you're trying to lazy load on purpose you may cry about performance issues.
class MyGroup(click.MultiCommand):
"""Dynamic group loader class."""
folder = None
def __init__(self, **kwargs):
click.MultiCommand.__init__(self, **kwargs)
self.commands = self._get_commands()
def _get_commands(self):
commands = {}
for command in self.list_commands(self):
commands[command] = self.get_command(self, command)
return commands
When using Custom Multi Commands sphinx-click doesn't document the subcommands because
multicommand.commands
is emptyA quick solution on click's side would be to manually populate the commands attribute by loading all the commands but if you're trying to lazy load on purpose you may cry about performance issues.
I also patched a partial fix in https://github.com/omercnet/sphinx-click/commit/749761828ba2c22d94bb6128e35e7e2955c71786 but it doesn't show the
MultiCommand
name in the docs (returns None), if anyone is willing to help finish it off that would be great :)