From 8137afb928ddcc69e41fa20c6aae0e9fc6184688 Mon Sep 17 00:00:00 2001 From: Walter Baccinelli Date: Thu, 27 Jun 2024 14:06:04 +0200 Subject: [PATCH] created CLI command --- cli/__init__.py | 0 cli/cli.py | 21 +++++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 cli/__init__.py create mode 100644 cli/cli.py diff --git a/cli/__init__.py b/cli/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/cli/cli.py b/cli/cli.py new file mode 100644 index 0000000..b853a9b --- /dev/null +++ b/cli/cli.py @@ -0,0 +1,21 @@ +import click +from eit_dash.app import app + + +@click.group(invoke_without_command=True) +@click.pass_context +def cli(ctx): + """Default prompt. It shows the help command""" + if ctx.invoked_subcommand is None: + click.echo(ctx.get_help()) + + +@cli.command(name="run", help="Start the dashboard.") +def run(): + """Start the dashboard.""" + + app.run_server(debug=False) + + +if __name__ == "__main__": + cli()