INNER CODE UNIT · Python
list_commands
overhangio/tutor · tutor/commands/cli.py:55
def list_commands(self, ctx: click.Context) -> list[str]:
"""
This is run in the following cases:
- shell autocompletion: tutor <tab>
- print help: tutor, tutor -h
"""
self.ensure_plugins_enabled(ctx)
return super().list_commands(ctx)
def ensure_plugins_enabled(self, ctx: click.Context) -> None:
"""
We enable plugins as soon as possible to have access to commands.
"""
if "root" not in ctx.params:
# When generating docs, this function is called with empty args.
# That's ok, we just ignore it.
return
if not self.IS_ROOT_READY: