summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-01-23 21:33:57 +0200
committerPaul Buetow <paul@buetow.org>2026-01-23 21:33:57 +0200
commit045e54404b101cad659547105439fcf1adb2d6de (patch)
tree3bcae0daed856b08641d86aa82560a334239df46 /cmd
parent4efabb7053c9e02c4cd1c0b687ba8b53e23ffa2b (diff)
feat: implement version management and improved error handling
Co-authored-by: aider (ollama/qwen3-coder:latest) <aider@aider.chat>
Diffstat (limited to 'cmd')
-rw-r--r--cmd/gogios/main.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/cmd/gogios/main.go b/cmd/gogios/main.go
index 580d150..ece7ca2 100644
--- a/cmd/gogios/main.go
+++ b/cmd/gogios/main.go
@@ -9,8 +9,6 @@ import (
"codeberg.org/snonux/gogios/internal"
)
-const versionStr = "v1.3.0"
-
func main() {
configFile := flag.String("cfg", "/etc/gogios.json", "The config file")
timeout := flag.Int("timeout", 5, "Global timeout in minutes")
@@ -20,7 +18,7 @@ func main() {
flag.Parse()
if *version {
- fmt.Printf("This is Gogios version %s; (C) by Paul Buetow\n", versionStr)
+ fmt.Printf("This is Gogios version %s; (C) by Paul Buetow\n", internal.Version)
fmt.Println("https://codeberg.org/snonux/gogios")
return
}
@@ -29,5 +27,8 @@ func main() {
time.Duration(*timeout)*time.Minute)
defer cancel()
- internal.Run(ctx, *configFile, *renotify, *force)
+ if err := internal.Run(ctx, *configFile, *renotify, *force); err != nil {
+ fmt.Fprintf(os.Stderr, "Error running gogios: %v\n", err)
+ os.Exit(1)
+ }
}