aboutsummaryrefslogtreecommitdiff
path: root/rui.go
diff options
context:
space:
mode:
authorFuwn <[email protected]>2024-10-12 00:36:25 -0700
committerFuwn <[email protected]>2024-10-12 00:36:37 -0700
commitc58dd53455fefe10b6ffa763705a8435c9ef90d2 (patch)
treebb6d2b700009c8144531d865338288ea5ce20897 /rui.go
parent34a9c134820d83816d4997f98dd18b36a65f2966 (diff)
downloadrui-c58dd53455fefe10b6ffa763705a8435c9ef90d2.tar.xz
rui-c58dd53455fefe10b6ffa763705a8435c9ef90d2.zip
feat(rui): wrap cli in error handler
Diffstat (limited to 'rui.go')
-rw-r--r--rui.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/rui.go b/rui.go
index dab9907..372e4c0 100644
--- a/rui.go
+++ b/rui.go
@@ -87,7 +87,7 @@ func main() {
},
}
- (&cli.App{
+ if err := (&cli.App{
Name: "rui",
Usage: "Personal NixOS Flake Manager",
Description: "Personal NixOS Flake Manager",
@@ -102,6 +102,7 @@ func main() {
ExitErrHandler: func(c *cli.Context, err error) {
if err != nil {
fmt.Println(err)
+ os.Exit(1)
}
},
Suggest: true,
@@ -227,7 +228,10 @@ func main() {
},
},
},
- }).Run(os.Args)
+ }).Run(os.Args); err != nil {
+ fmt.Println(err)
+ os.Exit(1)
+ }
}
func command(name string, args ...string) error {