INNER CODE UNIT · Python
cli
overhangio/tutor · tutor/commands/cli.py:103
def cli(context: click.Context, root: str, show_help: bool) -> None:
if utils.is_root():
fmt.echo_alert(
"You are running Tutor as root. This is strongly not recommended. If you are doing this in order to access"
" the Docker daemon, you should instead add your user to the 'docker' group. (see https://docs.docker.com"
"/install/linux/linux-postinstall/#manage-docker-as-a-non-root-user)"
)
context.obj = Context(root)
context.help_option_names = ["-h", "--help"]
if context.invoked_subcommand is None or show_help:
click.echo(context.get_help())
@click.command(help="Print this help", name="help")
@click.pass_context
def help_command(context: click.Context) -> None:
context.invoke(cli, show_help=True)