trying to get sub label showed properly
This commit is contained in:
@@ -29,6 +29,8 @@ def import_group() -> None:
|
||||
help="Only import activities after this date (default: incremental from last sync).")
|
||||
@click.option("--reauth", is_flag=True, default=False,
|
||||
help="Force re-authorization even if valid tokens exist.")
|
||||
@click.option("--dev", "dev_sample", default=None, type=int, metavar="N",
|
||||
help="Dev mode: import only the N most recent activities, output to /tmp/bincio_dev/.")
|
||||
def strava_cmd(
|
||||
client_id: Optional[str],
|
||||
client_secret: Optional[str],
|
||||
@@ -36,6 +38,7 @@ def strava_cmd(
|
||||
config_path: Optional[str],
|
||||
since: Optional[str],
|
||||
reauth: bool,
|
||||
dev_sample: Optional[int],
|
||||
) -> None:
|
||||
"""Import activities from Strava.
|
||||
|
||||
@@ -90,7 +93,11 @@ def strava_cmd(
|
||||
"Add them to extract_config.yaml under import.strava, or pass --client-id/--client-secret."
|
||||
)
|
||||
|
||||
out = _resolve_output(output_dir, cfg)
|
||||
if dev_sample is not None:
|
||||
out = Path("/tmp/bincio_dev")
|
||||
console.print(f"[yellow]Dev mode:[/yellow] importing {dev_sample} activities → [cyan]{out}[/cyan]")
|
||||
else:
|
||||
out = _resolve_output(output_dir, cfg)
|
||||
console.print(f"Output dir: [cyan]{out}[/cyan]")
|
||||
|
||||
if reauth and TOKENS_FILE.exists():
|
||||
@@ -108,7 +115,7 @@ def strava_cmd(
|
||||
except ValueError:
|
||||
raise click.BadParameter(f"Expected YYYY-MM-DD, got {since!r}", param_hint="--since")
|
||||
|
||||
strava_sync(client, out, since_dt, console)
|
||||
strava_sync(client, out, since_dt, console, limit=dev_sample)
|
||||
|
||||
|
||||
def _load_config(config_path: Optional[str]):
|
||||
|
||||
Reference in New Issue
Block a user