Skip to content

Commit

Permalink
Make autocomplete faster
Browse files Browse the repository at this point in the history
Autocompleting the commands was insanely slow.  Putting imports
inside the commands helped.  I got the idea from this issue:
fastapi/typer#231
  • Loading branch information
hlmore committed Apr 10, 2024
1 parent 87c64b1 commit 65252d3
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions src/beaverdam/cli/cli.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
import typer

from beaverdam.builder import build_database
from beaverdam.viewer import run_ui

# Create subcommand apps
# build = typer.Typer()
# view = typer.Typer()

# Create main app

app = typer.Typer()

# Add commands for each functionality


@app.command()
def build(config_file_name):
from beaverdam.builder import build_database

build_database(config_file_name)


@app.command()
def view(config_file_name):
run_ui(config_file_name)
from beaverdam.viewer import run_ui

run_ui(config_file_name)

0 comments on commit 65252d3

Please sign in to comment.