Added example of using bash completion (#86)

Added example using bash completion.

Example clones into `~/.kubectx` for people who don't want to make modifications outside of `$HOME`.
This commit is contained in:
Mitchell Turner
2018-09-17 02:31:35 -04:00
committed by Ahmet Alp Balkan
parent 41296a5fcf
commit 6811a5f03c

View File

@@ -114,7 +114,20 @@ them to any POSIX environment that has Bash installed.
Note that the leading underscore seems to be a convention.
If not using oh-my-zsh, you could link to `/usr/share/zsh/functions/Completion` (might require sudo), depending on the `$fpath` of your zsh installation.
In case of error, calling `compaudit` might help.
- For bash/fish: Figure out how to install completion scripts and please document here
- For bash:
```bash
git clone https://github.com/ahmetb/kubectx.git ~/.kubectx
COMPDIR=$(pkg-config --variable=completionsdir bash-completion)
ln -sf ~/.kubectx/completion/kubens.bash $COMPDIR/kubens
ln -sf ~/.kubectx/completion/kubectx.bash $COMPDIR/kubectx
cat << FOE >> ~/.bashrc
#kubectx and kubens
export PATH=~/.kubectx:\$PATH
FOE
```
- For fish: Figure out how to install completion scripts and please document here
Example installation steps: