diff options
| author | Paul Buetow <paul@buetow.org> | 2023-04-24 09:10:03 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2023-04-24 09:10:03 +0300 |
| commit | 3abf436db869c99586ff55af9bd562a33d114607 (patch) | |
| tree | 9fb7ab1ce4380557b3b80704e0d059eea0c07ec5 | |
| parent | 356af727a8648bcff6309650b78f3f43af0c89c6 (diff) | |
add version string
| -rw-r--r-- | cmd/gogios/main.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/cmd/gogios/main.go b/cmd/gogios/main.go index 516c498..3394e94 100644 --- a/cmd/gogios/main.go +++ b/cmd/gogios/main.go @@ -3,17 +3,27 @@ package main import ( "context" "flag" + "fmt" "time" "codeberg.org/snonux/gogios/internal" ) +const versionStr = "v0.0.0" + func main() { configFile := flag.String("cfg", "/etc/gogios.json", "The config file") timeout := flag.Int("timeout", 5, "Global timeout in minutes") renotify := flag.Bool("renotify", false, "Renotify all unhandled") + version := flag.Bool("version", false, "Display version") flag.Parse() + if *version { + fmt.Printf("This is Gogios version %s; (C) by Paul Buetow\n", versionStr) + fmt.Println("https://codeberg.org/snonux/gogios") + return + } + ctx, cancel := context.WithTimeout(context.Background(), time.Duration(*timeout)*time.Minute) defer cancel() |
