-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
fix(install): --with-short-names flag stop working #112
Comments
Hmm looks like this happened in the Homebrew repo. Homebrew/homebrew-core@f01c536 See Homebrew/homebrew-core#31510 for some of the rationale. I'm still trying to parse the explanation myself. Open to any ideas about how to fix this. |
Looks like options are gone, for good. We need to find alternatives. We could easily tell people to do |
Could you make the "official" commands |
According to brew analytics, only 20% of the people use —with-short-names option, so I don’t think distributing with the short names by default is a good idea. https://formulae.brew.sh/analytics/install/365d/ |
Ah, good point. |
Perhaps another brew package can be replicated with that option on as default? So technically you can install both if you wanted both commands to run, or just one if you prefer one of it. |
This is a good suggestion, but I'm not positive about replicating the package management formula. We get stuff like automatic releases and install analytics with Homebrew, and I intend to keep it that way. |
First measure to avoid confusing people. see ahmetb#112
First measure to avoid confusing people. see #112
Why this option (with short names) has been removed ? |
Homebrew removed options on formulas. |
so maybe you change a name of the package ? kctx is way more convenient that kubectx :-) |
That's subjective, and I disagree. 75% users installed via Homebrew use the long form, and you can always do You can also download kubectx file, and save it to your /usr/local/bin as kctx, it should still work as it doesn't have dependencies to other files. In this case, Homebrew screwed us, I wish it offered some means of keeping this functionality. I thought of forking the brew formula and hosting it myself as a tap, but that's suboptimal and we lose brew features like auto-version-bump, analytics and discoverability. |
This isn't a full solution, but I've gotten around this by adding to my if [ $(command -v kubectx) ] && ! [ $(command -v kctx) ]; then
CMD="$(which kubectx)"
ln -s $CMD /usr/local/bin/kctx || alias kctx=$CMD
fi
if [ $(command -v kubens) ] && ! [ $(command -v kns) ]; then
CMD="$(which kubens)"
ln -s $CMD /usr/local/bin/kns || alias kns=$CMD
fi I do the symlink first because that actually works for things like |
@dotLou if you're putting things in your bashrc/zshrc, you might as well just create an The main reason why people asked for shorter names like kctx is because when they type |
Are you 100% sure they know that it can be installed and used with short name ? I am pretty sure that if it was by default they wouldn't use the long name. |
So you got me thinking about the So for those watching, just do: if [ $(command -v kubectx) ] && ! [ $(command -v kctx) ]; then
alias kctx=kubectx
fi
if [ $(command -v kubens) ] && ! [ $(command -v kns) ]; then
alias kns=kubens
fi |
Simplest fix: max-lobur/dotfiles@722238e |
If you alias, then somehow mask the kubectx/kubens executables (so kube/tab/tab completion doesn’t bring it up) you’re good to go. 👍🏼 |
@ahmetb I use |
I've added this to remove full names so that they don't appear in completion. Now I just need to remember to update versions in bash profile :) :
Updated my snippet to include version detection and fix for completion |
@gordonbondon you can use |
I think this can be closed as aliasing is the only real path forward here if using homebrew :) |
Hi,
First, thanks for this tool which is very useful ❤️
I've installed it on a new computer and I have, when trying to install the short name version the following result with
brew
:So the
--with-short-names
isn't available and we can't access thekctx
command line. Is it normal? Is it a bug on the installation or the documentation which should be updated?Thanks
The text was updated successfully, but these errors were encountered: