Comments (8)
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?
from kubectx.
git --help
and curl -h
both returned 0 status on my system. To be fair I thought it is very common to return 0 staus for help. At least I thought exit status 1 is for erroneous states.
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 (kubectx -h || true
) but I was just surprised. I do not consider myself a bash guru so I asked ;)
The tool I am writing will be hopefully open-sourced soon.
I think there is no solution to this issue, therefore you can close it.
BTW thanks for the great tools 👍
from kubectx.
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.
from kubectx.
from kubectx.
Yes.
from kubectx.
prepared PR to homebrew too Homebrew/homebrew-core#31288
from kubectx.
We still haven't tagged a release yet, I'll ping you when we're ready to tag another release.
from kubectx.
thanks :)
from kubectx.
Related Issues (20)
- git bash windows fzf error HOT 4
- Are go versions still considered not stable? HOT 2
- kubie and kubens mixed cause kubeconfig syntax error HOT 12
- Can’t use `--height` in fzf options on Windows HOT 2
- blank issue HOT 1
- Add --selector option to kubens HOT 1
- Feature Request: Use kubectx to use right version of kubectl binary for a given K8s cluster HOT 1
- `kubens` fails with `invalid apiVersion "client.authentication.k8s.io/v1"` but `kubectl` works normally HOT 2
- Vulnerability of dependency "golang.org/x/net" HOT 1
- Add completions for Nushell
- Add kubectl plugin installation to Homebrew formula HOT 4
- [Go] kubens not working with in-cluster config HOT 1
- show all of NAME, CLUSTER and AUTHINFO in cluster selection list HOT 2
- Allow customizing path to KUBECTX and KUBENS_DIR
- Homebrew install makes kubectx slow HOT 6
- Autocomplete does not work when installed as Krew plugin HOT 2
- Autocomplete breaks when multiple longer contexts match HOT 2
- kubectl ctx outputs code lines start with plus sign + HOT 1
- error: open /home/myuser/.kube/config: permission denied HOT 1
- Consider open up internal packages HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kubectx.