Skip to content

Commit c626cf0

Browse files
justinabrahmsclaude
andcommitted
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 <noreply@anthropic.com>
1 parent a4c6dab commit c626cf0

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ gitstreams
4040
| `-token` | GitHub token (default: `$GITHUB_TOKEN`) |
4141
| `-db` | Path to SQLite database (default: `~/.gitstreams/gitstreams.db`) |
4242
| `-report` | Path to write HTML report (default: temp file) |
43-
| `-days` | Number of days to look back for activity (1-365, default: 30) |
43+
| `-sync-lookback-days` | How far back to fetch GitHub data (1-365 days, default: 30) |
4444
| `-offline` | Skip GitHub API sync and use cached data |
4545
| `-no-notify` | Skip desktop notification |
4646
| `-no-open` | Don't open report in browser |
@@ -55,8 +55,8 @@ gitstreams -no-notify -no-open -report ~/reports/today.html
5555
# Verbose mode with custom database
5656
gitstreams -v -db /path/to/my.db
5757

58-
# Only show activity from the last 7 days
59-
gitstreams -days 7
58+
# Fetch GitHub data from the last 7 days
59+
gitstreams -sync-lookback-days 7
6060

6161
# Use cached data without hitting GitHub API (fast, but may be stale)
6262
gitstreams -offline

main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ type Config struct {
4040
Token string
4141
ReportPath string
4242
Since string // Generate report from this date (e.g., '2026-01-15' or '7d')
43-
Days int // Number of days to look back for activity (default 30)
43+
Days int // How far back to fetch GitHub data (API sync lookback, default 30)
4444
NoNotify bool
4545
NoOpen bool
4646
Verbose bool
@@ -373,7 +373,7 @@ func parseFlags(args []string) (*Config, error) {
373373
fs.StringVar(&cfg.ReportPath, "report", "", "Path to write HTML report (default: temp file)")
374374
fs.BoolVar(&cfg.Verbose, "v", false, "Verbose output")
375375
fs.BoolVar(&showVersion, "version", false, "Print version and exit")
376-
fs.IntVar(&cfg.Days, "days", 30, "Number of days to look back for activity (1-365)")
376+
fs.IntVar(&cfg.Days, "sync-lookback-days", 30, "How far back to fetch GitHub data (1-365 days, doesn't affect report filtering)")
377377
fs.StringVar(&cfg.Since, "since", "", "Generate report from historical data (e.g., '2026-01-15' or '7d' for 7 days ago)")
378378
fs.BoolVar(&cfg.Offline, "offline", false, "Use only cached data, skip GitHub API calls")
379379

main_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1023,7 +1023,7 @@ func TestRun_DaysFlag(t *testing.T) {
10231023
result := run(&stdout, &stderr, []string{
10241024
"-token", "test-token",
10251025
"-db", filepath.Join(tmpDir, "test.db"),
1026-
"-days", "7",
1026+
"-sync-lookback-days", "7",
10271027
"-no-open",
10281028
"-no-notify",
10291029
}, deps)
@@ -1041,7 +1041,7 @@ func TestRun_DaysFlagInvalid(t *testing.T) {
10411041
// Test with invalid days (too low)
10421042
result := run(&stdout, &stderr, []string{
10431043
"-token", "test-token",
1044-
"-days", "0",
1044+
"-sync-lookback-days", "0",
10451045
}, deps)
10461046

10471047
if result != 1 {
@@ -1056,7 +1056,7 @@ func TestRun_DaysFlagInvalid(t *testing.T) {
10561056
stderr.Reset()
10571057
result = run(&stdout, &stderr, []string{
10581058
"-token", "test-token",
1059-
"-days", "400",
1059+
"-sync-lookback-days", "400",
10601060
}, deps)
10611061

10621062
if result != 1 {

0 commit comments

Comments
 (0)