mirror of
https://github.com/SikongJueluo/Mini-Nav.git
synced 2026-03-12 12:25:32 +08:00
refactor(cli): migrate from argparse to typer for command-line interface
This commit is contained in:
12
mini-nav/commands/visualize.py
Normal file
12
mini-nav/commands/visualize.py
Normal file
@@ -0,0 +1,12 @@
|
||||
import typer
|
||||
|
||||
|
||||
def visualize(
|
||||
ctx: typer.Context,
|
||||
host: str = typer.Option("127.0.0.1", "--host", help="Server host"),
|
||||
port: int = typer.Option(8050, "--port", "-p", help="Server port"),
|
||||
debug: bool = typer.Option(True, "--debug/--no-debug", help="Enable debug mode"),
|
||||
):
|
||||
from visualizer import app as dash_app
|
||||
|
||||
dash_app.run(host=host, port=port, debug=debug)
|
||||
Reference in New Issue
Block a user