From c626cf006c10e00edcb63f876ab42d24790e3571 Mon Sep 17 00:00:00 2001 From: Justin Abrahms Date: Thu, 22 Jan 2026 09:28:56 -0800 Subject: [PATCH] Rename -days flag to -sync-lookback-days Clarifies that this flag controls how far back the GitHub API sync fetches, not what appears in the report. The -since flag controls report filtering independently. - Renamed flag from -days to -sync-lookback-days - Updated flag description for clarity - Updated all test references - Updated README.md documentation - Kept default value at 30 days Co-Authored-By: Claude Sonnet 4.5 --- README.md | 6 +++--- main.go | 4 ++-- main_test.go | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 140084c..0724bb8 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ gitstreams | `-token` | GitHub token (default: `$GITHUB_TOKEN`) | | `-db` | Path to SQLite database (default: `~/.gitstreams/gitstreams.db`) | | `-report` | Path to write HTML report (default: temp file) | -| `-days` | Number of days to look back for activity (1-365, default: 30) | +| `-sync-lookback-days` | How far back to fetch GitHub data (1-365 days, default: 30) | | `-offline` | Skip GitHub API sync and use cached data | | `-no-notify` | Skip desktop notification | | `-no-open` | Don't open report in browser | @@ -55,8 +55,8 @@ gitstreams -no-notify -no-open -report ~/reports/today.html # Verbose mode with custom database gitstreams -v -db /path/to/my.db -# Only show activity from the last 7 days -gitstreams -days 7 +# Fetch GitHub data from the last 7 days +gitstreams -sync-lookback-days 7 # Use cached data without hitting GitHub API (fast, but may be stale) gitstreams -offline diff --git a/main.go b/main.go index 4433183..08a0003 100644 --- a/main.go +++ b/main.go @@ -40,7 +40,7 @@ type Config struct { Token string ReportPath string Since string // Generate report from this date (e.g., '2026-01-15' or '7d') - Days int // Number of days to look back for activity (default 30) + Days int // How far back to fetch GitHub data (API sync lookback, default 30) NoNotify bool NoOpen bool Verbose bool @@ -373,7 +373,7 @@ func parseFlags(args []string) (*Config, error) { fs.StringVar(&cfg.ReportPath, "report", "", "Path to write HTML report (default: temp file)") fs.BoolVar(&cfg.Verbose, "v", false, "Verbose output") fs.BoolVar(&showVersion, "version", false, "Print version and exit") - fs.IntVar(&cfg.Days, "days", 30, "Number of days to look back for activity (1-365)") + fs.IntVar(&cfg.Days, "sync-lookback-days", 30, "How far back to fetch GitHub data (1-365 days, doesn't affect report filtering)") fs.StringVar(&cfg.Since, "since", "", "Generate report from historical data (e.g., '2026-01-15' or '7d' for 7 days ago)") fs.BoolVar(&cfg.Offline, "offline", false, "Use only cached data, skip GitHub API calls") diff --git a/main_test.go b/main_test.go index b0e9b04..10a56d4 100644 --- a/main_test.go +++ b/main_test.go @@ -1023,7 +1023,7 @@ func TestRun_DaysFlag(t *testing.T) { result := run(&stdout, &stderr, []string{ "-token", "test-token", "-db", filepath.Join(tmpDir, "test.db"), - "-days", "7", + "-sync-lookback-days", "7", "-no-open", "-no-notify", }, deps) @@ -1041,7 +1041,7 @@ func TestRun_DaysFlagInvalid(t *testing.T) { // Test with invalid days (too low) result := run(&stdout, &stderr, []string{ "-token", "test-token", - "-days", "0", + "-sync-lookback-days", "0", }, deps) if result != 1 { @@ -1056,7 +1056,7 @@ func TestRun_DaysFlagInvalid(t *testing.T) { stderr.Reset() result = run(&stdout, &stderr, []string{ "-token", "test-token", - "-days", "400", + "-sync-lookback-days", "400", }, deps) if result != 1 {