Skip to content

Commit bf15561

Browse files
authored
docs: update kpt completion docs (#2673)
This change makes two key updates to the completion docs: - Provide instructions to remove an artifact of previous installations which breaks kpt completion functionality. This issue was reported by a user of kpt. - Direct the user to the help command for per-shell instructions to enable kpt completion. Since the completion functionality is provided by a third party library (cobra), this ensures the user is provided with accurate and up to date instructions.
1 parent e72f21e commit bf15561

File tree

1 file changed

+11
-29
lines changed

1 file changed

+11
-29
lines changed

site/installation/README.md

Lines changed: 11 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -32,41 +32,23 @@ $ kpt version
3232
kpt provides auto-completion support for several of the common shells.
3333
To see the options for enabling shell auto-completion:
3434
```shell
35-
kpt completion -h
35+
$ kpt completion -h
3636
```
3737

3838
### Prerequisites
39-
`kpt` depends on `bash-completion` in order to support auto-completion for the
40-
bash shell. If you are using bash as your shell, you will need to install
41-
`bash-completion` in order to use kpt's auto-completion feature.
42-
`bash-completion` is provided by many package managers
43-
(see [here][bash-completion]).
39+
Previous installations of kpt completion may have added the following line to
40+
the shell's config file (e.g. `.bashrc`, `.zshrc`, etc.):
41+
```shell
42+
complete -C <KPT_PATH> kpt
43+
```
44+
This line needs to be removed for kpt's completion implementation to function
45+
properly.
4446

4547
### Enable kpt auto-completion
4648
The kpt completion script for a shell can be generated with the commands
47-
`kpt completion bash`, `kpt completion zsh`, etc. Sourcing the completion script
48-
in your shell enables auto-completion.
49-
50-
#### Enable auto-completion for your current shell
51-
bash:
52-
```shell
53-
source <(kpt completion bash)
54-
```
55-
zsh:
56-
```shell
57-
source <(kpt completion zsh)
58-
```
59-
etc.
60-
#### Enable kpt completion for all your shell sessions
61-
bash:
62-
```shell
63-
echo 'source <(kpt completion bash)' >> ~/.bashrc
64-
```
65-
zsh:
66-
```shell
67-
echo 'source <(kpt completion zsh)' >> ~/.zshrc
68-
```
69-
etc.
49+
`kpt completion bash`, `kpt completion zsh`, etc.
50+
For instructions on how to enable the script for the given shell, see the help
51+
page with the commands `kpt completion bash -h`, `kpt completion zsh -h`, etc.
7052

7153
<!-- gcloud and homebrew are not yet available for builds from the main branch.
7254
## gcloud

0 commit comments

Comments
 (0)