Skip to content

Commit 2d5b300

Browse files
committed
fix(time/download): invert click flag for all entries
don't need to tie the flag to the Toggl parameter name, this is more explicit and fixes broken tests
1 parent effa197 commit 2d5b300

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

compiler_admin/commands/time/download.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ def prior_month_start():
4545
)
4646
@click.option(
4747
"--all",
48-
"billable",
48+
"include_all",
4949
is_flag=True,
50-
default=True,
50+
default=False,
5151
help="Download all time entries. The default is to download only billable time entries.",
5252
)
5353
@click.option(
@@ -91,7 +91,7 @@ def download(
9191
start: datetime,
9292
end: datetime,
9393
output: str = "",
94-
billable: bool = True,
94+
include_all: bool = False,
9595
client_ids: List[int] = [],
9696
project_ids: List[int] = [],
9797
task_ids: List[int] = [],
@@ -103,8 +103,10 @@ def download(
103103

104104
params = dict(start_date=start, end_date=end, output_path=output, output_cols=TOGGL_COLUMNS)
105105

106-
if billable:
107-
params.update(dict(billable=billable))
106+
# By default include billable=True in params.
107+
# If --all was passed, do not add billable so callers can treat absence as "all".
108+
if not include_all:
109+
params.update(dict(billable=True))
108110
if client_ids:
109111
params.update(dict(client_ids=client_ids))
110112
if project_ids:

0 commit comments

Comments
 (0)