-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[cli] Add flags to change exit codes on plan command #236
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
f.IntVar(&flag.IntVar{ | ||
Name: "exit-code-no-changes", | ||
Target: &c.exitCodeNoChanges, | ||
Default: 0, | ||
Usage: `Override exit code returned when the plan shown no changes.`, | ||
}) | ||
|
||
f.IntVar(&flag.IntVar{ | ||
Name: "exit-code-makes-changes", | ||
Target: &c.exitCodeChanges, | ||
Default: 1, | ||
Usage: `Override exit code returned when the plan shows changes.`, | ||
}) | ||
|
||
f.IntVar(&flag.IntVar{ | ||
Name: "exit-code-error", | ||
Target: &c.exitCodeError, | ||
Default: 255, | ||
Usage: `Override exit code returned when there is an error.`, | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One alternative that I thought would be to have k=v
flag that can be defined multiple times instead of specific flags:
$ nomad-pack plan -exit-code "error=20" -exit-code "no-changes=2"
It seems like it would be easier to add new values, but I don't know if it would actually provide any real benefit.
23e1df6
to
44327cf
Compare
Description
Provide CLI flags to allow end users to specify the exit codes for the
plan
command.Closes #224
Reminders
CHANGELOG.md
entry