From 9d037786f2222b0d1fee8b605914bb131b210f24 Mon Sep 17 00:00:00 2001 From: Bryan Tegomoh Date: Mon, 13 Apr 2026 09:18:18 -0500 Subject: [PATCH] fix(cli): restore --days alias compatibility --- scripts/last30days.py | 9 ++++++++- tests/test_cli_v3.py | 7 +++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/scripts/last30days.py b/scripts/last30days.py index 03b8a8f..d6d334f 100644 --- a/scripts/last30days.py +++ b/scripts/last30days.py @@ -165,7 +165,14 @@ def build_parser() -> argparse.ArgumentParser: parser.add_argument("--tiktok-hashtags", help="Comma-separated TikTok hashtags without # (e.g., tella,screenrecording)") parser.add_argument("--tiktok-creators", help="Comma-separated TikTok creator handles (e.g., TellaHQ,taborplace)") parser.add_argument("--ig-creators", help="Comma-separated Instagram creator handles (e.g., tella.tv,laborstories)") - parser.add_argument("--lookback-days", type=int, default=30, help="Number of days to look back for research (default: 30, watchlist uses 90)") + parser.add_argument( + "--days", + "--lookback-days", + dest="lookback_days", + type=int, + default=30, + help="Number of days to look back for research (default: 30, watchlist uses 90)", + ) parser.add_argument("--auto-resolve", action="store_true", help="Use web search to discover subreddits/handles before planning (for platforms without WebSearch)") parser.add_argument("--github-user", help="GitHub username for person-mode search (e.g., steipete)") diff --git a/tests/test_cli_v3.py b/tests/test_cli_v3.py index 538e36f..7e4440c 100644 --- a/tests/test_cli_v3.py +++ b/tests/test_cli_v3.py @@ -77,6 +77,13 @@ class CliV3Tests(unittest.TestCase): with self.assertRaises(SystemExit): cli.parse_search_flag(" , ") + def test_build_parser_accepts_days_alias_and_preserves_topic_tokens(self): + parser = cli.build_parser() + args, extra = parser.parse_known_args(["--days", "7", "biosecurity", "ai", "agents"]) + self.assertEqual(7, args.lookback_days) + self.assertEqual(["biosecurity", "ai", "agents"], args.topic) + self.assertEqual([], extra) + def test_ensure_supported_python_rejects_old_interpreter_with_actionable_error(self): stderr = io.StringIO() with redirect_stderr(stderr):