INNER CODE UNIT · Python
TutorCli
overhangio/tutor · tutor/commands/cli.py:35
class TutorCli(click.Group):
"""
Dynamically load subcommands at runtime.
This is necessary to load plugin subcommands, based on the list of enabled
plugins (and thus of config.yml).
Docs: https://click.palletsprojects.com/en/latest/commands/#custom-multi-commands
"""
IS_ROOT_READY = False
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)