adjust cli
This commit is contained in:
parent
4bda161e10
commit
20b95d087b
@ -13,7 +13,7 @@ dependencies = [
|
||||
]
|
||||
|
||||
[project.scripts]
|
||||
hello = "tt:hello"
|
||||
tt = "tt.cli:app"
|
||||
|
||||
[build-system]
|
||||
requires = ["hatchling"]
|
||||
|
@ -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__":
|
||||
|
@ -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!")
|
||||
|
Loading…
Reference in New Issue
Block a user