Refactor CLI exit code and error handling

This commit is contained in:
2021-01-17 21:08:13 -06:00
parent c816ee43e1
commit b9e98679a1
11 changed files with 47 additions and 35 deletions

View File

@ -23,8 +23,8 @@ func LsCmd(args CmdArgs) (int, error) {
selector := args.Flags.String("selector")
lights, err := c.ListLights(selector)
if err != nil {
return 1, err
return ExitError, err
}
PrintLights(lights)
return 0, nil
return ExitSuccess, nil
}