INNER CODE UNIT · Python
get_command
overhangio/tutor · tutor/commands/cli.py:46
def get_command(
self, ctx: click.Context, cmd_name: str
) -> t.Optional[click.Command]:
"""
This is run when passing a command from the CLI. E.g: tutor config ...
"""
self.ensure_plugins_enabled(ctx)
return super().get_command(ctx, cmd_name=cmd_name)
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)