adjust cli

This commit is contained in:
James Turk 2025-01-04 03:09:46 -06:00
parent 4bda161e10
commit 20b95d087b
3 changed files with 16 additions and 15 deletions

View File

@ -13,7 +13,7 @@ dependencies = [
]
[project.scripts]
hello = "tt:hello"
tt = "tt.cli:app"
[build-system]
requires = ["hatchling"]

View File

@ -1,10 +1,10 @@
import uuid
import typer
import httpx
import lxml.html
from datetime import datetime
from typing_extensions import Annotated
from .controller import add_task
from .import_csv import import_tasks_from_csv
from . import tui
app = typer.Typer()
@ -39,8 +39,14 @@ def new(
@app.command()
def search(q: str):
pass
def browse():
tui.run()
@app.command()
def import_csv(filename: str):
import_tasks_from_csv(filename)
print("Import complete!")
if __name__ == "__main__":

View File

@ -45,8 +45,3 @@ def import_tasks_from_csv(filename: str):
category_id=category_id,
)
print(f"Imported task: {row['task']}")
if __name__ == "__main__":
import_tasks_from_csv(sys.argv[1])
print("Import complete!")