initial commit

This commit is contained in:
2026-01-21 20:03:02 +11:00
commit 499136bcb8
41 changed files with 3069 additions and 0 deletions

36
cmd/oslstats/main.go Normal file
View File

@@ -0,0 +1,36 @@
package main
import (
"context"
"fmt"
"os"
"git.haelnorr.com/h/oslstats/internal/config"
"github.com/pkg/errors"
)
func main() {
flags := config.SetupFlags()
ctx := context.Background()
cfg, loader, err := config.GetConfig(flags)
if err != nil {
fmt.Fprintf(os.Stderr, "%s\n", errors.Wrap(err, "Failed to load config"))
os.Exit(1)
}
if flags.EnvDoc || flags.ShowEnv {
loader.PrintEnvVarsStdout(flags.ShowEnv)
return
}
if flags.GenEnv != "" {
loader.GenerateEnvFile(flags.GenEnv, true)
return
}
if err := run(ctx, os.Stdout, cfg); err != nil {
fmt.Fprintf(os.Stderr, "%s\n", err)
os.Exit(1)
}
}