Skip to content

Commit

Permalink
minor cli changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Carson-Shaar committed Oct 16, 2023
1 parent c7b0af2 commit ac33a5a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
4 changes: 1 addition & 3 deletions zt_cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import os
import typer
from typing_extensions import Annotated
import logging
import uvicorn
from typing import Optional
from rich import print
Expand All @@ -26,7 +25,7 @@ def print_ascii_logo():
@app.command()
def start(mode: Annotated[Optional[str], typer.Argument(help="The mode to run zero-true in, can be one of 'notebook' and 'app'")],
host: Annotated[Optional[str], typer.Argument(help="Host address to bind to.")]="localhost",
port: Annotated[Optional[str],typer.Argument(help="Port number to bind to.")]=""):
port: Annotated[Optional[str], typer.Argument(help="Port number to bind to.")]=""):
"""
Start the Zero-True application.
"""
Expand All @@ -41,7 +40,6 @@ def start(mode: Annotated[Optional[str], typer.Argument(help="The mode to run ze
else:
typer.echo("Invalid mode. Choose either 'notebook' or 'app'.")
raise typer.Exit(code=1)


print(f"[yellow]Starting Zero-True in {mode} mode on http://{host}:{port}[/yellow]")

Expand Down
5 changes: 1 addition & 4 deletions zt_dev_cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,8 @@ def run_yarn_build():

@app.command()
def run(mode: Annotated[Optional[str], typer.Argument(help="The mode to run zero-true in, can be one of 'notebook' and 'app'")],
host: Annotated[Optional[str], typer.Argument(help="Host address to bind to.")]="0.0.0.0",
port: Annotated[Optional[str],typer.Argument(help="Port number to bind to.")]=""):
port: Annotated[Optional[str], typer.Argument(help="Port number to bind to.")]=""):

print(port)
print_ascii_logo()
port = port if port else 5173

Expand All @@ -81,6 +79,5 @@ def run(mode: Annotated[Optional[str], typer.Argument(help="The mode to run zero
backend_process.wait()
frontend_process.wait()


if __name__ == "__main__":
app()

0 comments on commit ac33a5a

Please sign in to comment.