-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
why help exits with 1? #69
Comments
There’s often no consensus on whether —help should exit with error in gnu tools and similar tools like curl, git etc. This is fine since the flag is meant to be used interactively and therefore prints to stderr, which is another indicator of it is not meant the help output should be used by the programs. 😊 If you try many tools, you’ll see some exit successfully on help and some won’t. My question would be more like what difference does this make for you in terms of kubectx context? Do you need to exit this with success status? |
But I get your point some tools may exit with status 1 for help. I am developing a tool for installing and keeping useful scripts up to date. It is based on https://github.com/slackhq/magic-cli but purely in bash and the installation is based on Make. Part of the installation is generating help which failed on exit status 1. It was simple to solve ( I think there is no solution to this issue, therefore you can close it. BTW thanks for the great tools 👍 |
I think this can be fixed easily and I'm ok with fixing it for --help. It can also be used in brew formula as a test, which does a nastier test today: https://github.com/Homebrew/homebrew-core/blob/a21926ac32853a1e64fdf23c74cec2d9e98cb0a8/Formula/kubectx.rb#L26-L29 Updating the exit code for --help would likely break this installation script, as it expects to see (1) Are you interested in fixing this in kubectx? We probably need to just move |
Yes I will gladly prepare PR. Does the same apply to `kubens`?
…On Mon, Aug 13, 2018, 18:58 Ahmet Alp Balkan ***@***.***> wrote:
I think this can be fixed easily and I'm ok with fixing it for --help.
It can also be used in brew formula as a test, which does a nastier test
today:
https://github.com/Homebrew/homebrew-core/blob/a21926ac32853a1e64fdf23c74cec2d9e98cb0a8/Formula/kubectx.rb#L26-L29
Updating the exit code for --help would likely break this installation
script, as it expects to see (1) exit code 1 (2) "USAGE:" in --help
stderr output. So we just need to tag a release and update brew formula
with this.
Are you interested in fixing this in kubectx? We probably need to just
move exit out of usage function.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#69 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ADPFo5dO0PW4HHJvEfLLxUBcHvHgpXbGks5uQbApgaJpZM4V5H6I>
.
|
Yes. |
prepared PR to homebrew too Homebrew/homebrew-core#31288 |
We still haven't tagged a release yet, I'll ping you when we're ready to tag another release. |
thanks :) |
- FEATURE: interactive search mode when kubectx and kubens are ran without any arguments and fzf(1) is detected in PATH. (#71, #74) - FIX: kubectx -d now doesn't ignore arguments after the first argument. (#75) - FIX: empty output bug when TERM=vt100 even though NO_COLOR is set. (#57, #73) - FIX: --help exits with code 0 now. (#69, #72)
https://github.com/ahmetb/kubectx/blob/master/kubectx#L40
The text was updated successfully, but these errors were encountered: