diff options
| author | Paul Buetow <paul@buetow.org> | 2025-09-24 22:45:46 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2025-09-24 22:45:46 +0300 |
| commit | 970b9b3754f2798f234f99c54f161acb4931b3b7 (patch) | |
| tree | f8b1af179e59ab05bc749dc20892e59f382dbde7 /internal/main.go | |
| parent | 16ce1d306f89f44974eb033056bc65c1be9a5f8a (diff) | |
add --stats flag
Diffstat (limited to 'internal/main.go')
| -rw-r--r-- | internal/main.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/internal/main.go b/internal/main.go index 1e7d023..9bc0507 100644 --- a/internal/main.go +++ b/internal/main.go @@ -10,6 +10,7 @@ import ( "time" "codeberg.org/snonux/gos/internal/config" + "codeberg.org/snonux/gos/internal/schedule" ) func Main(composeModeDefault bool) { @@ -31,6 +32,7 @@ func Main(composeModeDefault bool) { geminiSummaryFor := flag.String("geminiSummaryFor", "", "Generate a summary in Gemini Gemtext format, format is coma separated string of months, e.g. 202410,202411") geminiCapsules := flag.String("geminiCapsules", "foo.zone", "Comma sepaeated list Gemini capsules. Used by geminiEnable to detect Gemtext links") gemtexterEnable := flag.Bool("gemtexterEnable", false, "Add special Gemtexter (the static site generator) tags to the Gemini Gemtext summary") + statsOnly := flag.Bool("stats", false, "Print statistics for all social networks and exit") flag.Parse() conf, err := config.New(configPath, *composeMode) @@ -54,6 +56,7 @@ func Main(composeModeDefault bool) { GemtexterEnable: *gemtexterEnable, GeminiCapsules: strings.Split(*geminiCapsules, ","), ComposeMode: *composeMode, + StatsOnly: *statsOnly, } if *geminiSummaryFor != "" { args.GeminiSummaryFor = strings.Split(*geminiSummaryFor, ",") @@ -68,6 +71,12 @@ func Main(composeModeDefault bool) { return } + if args.StatsOnly { + // Call the new function to print all stats + schedule.PrintAllStats(args) + return // Exit after printing stats + } + ctx, cancel := context.WithCancel(context.Background()) defer cancel() |
