Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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")

Expand Down
6 changes: 3 additions & 3 deletions main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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 {
Expand All @@ -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 {
Expand Down
Loading