This repository has been archived on 2020-06-17. You can view files and clone it, but cannot push or open issues or pull requests.
autonomic/autonomic/__main__.py

35 lines
829 B
Python
Raw Normal View History

2020-04-03 12:46:29 +00:00
"""Command-line entrypoint."""
import os
2020-04-03 12:46:29 +00:00
import click
2020-04-10 23:45:53 +00:00
from autonomic.command import actions, init
2020-04-03 12:46:29 +00:00
@click.group()
@click.option(
"--debug/--no-debug",
default=False,
help="Enable or disable debug mode",
show_default=True,
)
@click.pass_context
def autonomic(ctx, debug):
2020-04-03 12:46:29 +00:00
"""
\b
___ _ _
/ _ \ | | (_)
/ /_\ \_ _| |_ ___ _ __ ___ _ __ ___ _ ___
| _ | | | | __/ _ \| '_ \ / _ \| '_ ` _ \| |/ __|
| | | | |_| | || (_) | | | | (_) | | | | | | | (__
\_| |_/\__,_|\__\___/|_| |_|\___/|_| |_| |_|_|\___|
""" # noqa
ctx.obj = {}
ctx.obj["DEBUG"] = debug
ctx.obj["HOME"] = "/home/{user}".format(user=os.getlogin())
2020-04-03 12:46:29 +00:00
autonomic.add_command(init.init)
2020-04-10 23:45:53 +00:00
autonomic.add_command(actions.actions)