Skip to content

Commit

Permalink
chore(cli): add exit flag
Browse files Browse the repository at this point in the history
  • Loading branch information
alisterd51 committed Feb 26, 2024
1 parent 147bfba commit 9a7498e
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion cmd/koherence/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,22 @@ import (
)

func main() {
var exitValue int

app := cli.NewApp()
app.Name = "koherence"
app.Usage = "Openstack/Kube/Machine coherence checker"
app.Version = version.Version

app.Flags = []cli.Flag{
cli.IntFlag{
Name: "exit, e",
Value: 1,
Usage: "value returned on error",
Destination: &exitValue,
},
}

app.Commands = []cli.Command{
debugCommand,
checkCommand,
Expand All @@ -25,6 +36,6 @@ func main() {
"main() error",
slog.String("error", err.Error()),
)
os.Exit(1)
os.Exit(exitValue)
}
}

0 comments on commit 9a7498e

Please sign in to comment.