Param is a datetime instead of a string

This commit is contained in:
Pablo Martin 2023-08-03 16:10:30 +02:00
parent c8d4583543
commit 1dddbf5ef1
2 changed files with 11 additions and 8 deletions

View file

@ -1,5 +1,9 @@
import datetime
import typer
from typing_extensions import Annotated
import camisatoshi_wordpress_reports.controllers as controllers
app = typer.Typer()
@ -11,6 +15,8 @@ def check_health():
@app.command()
def generate_um_report(start_date: str, end_date: str):
def generate_um_report(
start_date: Annotated[datetime.datetime, typer.Option(prompt=True)],
end_date: Annotated[datetime.datetime, typer.Option(prompt=True)],
):
controllers.generate_um_report(start_date, end_date)