From 028fda815bfb4a99a7ae05e2cbd9e60373ec825d Mon Sep 17 00:00:00 2001 From: Alex Kelly Date: Thu, 19 Aug 2021 15:20:21 -0400 Subject: [PATCH] feat: added --header option to display start date of report --- task_status/task_status.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/task_status/task_status.py b/task_status/task_status.py index 1973824..4d0a44c 100755 --- a/task_status/task_status.py +++ b/task_status/task_status.py @@ -11,7 +11,8 @@ __version__ = "0.1.1" @click.command() @click.version_option(__version__, prog_name="task-status") @click.option("--uuid", is_flag=True, help="Display the task UUID") -def main(uuid): +@click.option("--header", is_flag=True, help="Display date header") +def main(uuid, header): today = date.today() last_monday = today + relativedelta(weekday=MO(-2)) @@ -28,6 +29,8 @@ def main(uuid): entries = json.loads(tasks.stdout.decode()) last_project = "" + if header: + print(f"Reporting from: {last_monday}") for entry in entries: if entry["project"] != last_project: last_project = entry["project"]