Skip to content

Commit 8e535c0

Browse files
committed
Fix description of the completion option
Align the description with README Signed-off-by: Pradipta Banerjee <[email protected]>
1 parent 2e42b88 commit 8e535c0

File tree

1 file changed

+45
-19
lines changed

1 file changed

+45
-19
lines changed

cmd/completion.go

Lines changed: 45 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -15,34 +15,60 @@ var completionCmd = &cobra.Command{
1515
Short: "Generate shell completion script",
1616
Long: `Generate shell completion script for kubectl-coco.
1717
18-
PREREQUISITES:
18+
BASH
1919
20-
Bash requires bash-completion to be installed:
21-
macOS: brew install bash-completion@2
22-
Linux: Usually pre-installed (apt-get/yum install bash-completion)
20+
Prerequisites:
2321
24-
Add to your ~/.bash_profile (macOS):
25-
[[ -r "/opt/homebrew/etc/profile.d/bash_completion.sh" ]] && . "/opt/homebrew/etc/profile.d/bash_completion.sh"
22+
Install bash-completion.
2623
27-
BASH:
24+
For MacOS:
25+
$ brew install bash-completion@2
2826
29-
Current session:
30-
$ source <(kubectl-coco completion bash)
27+
# Add to your ~/.bash_profile:
28+
$ echo '[[ -r "/opt/homebrew/etc/profile.d/bash_completion.sh" ]] && . "/opt/homebrew/etc/profile.d/bash_completion.sh"' >> ~/.bash_profile
3129
32-
Permanent:
33-
$ kubectl-coco completion bash > $(brew --prefix)/etc/bash_completion.d/kubectl-coco
34-
$ source ~/.bash_profile
30+
# Reload profile:
31+
$ source ~/.bash_profile
3532
36-
ZSH:
33+
For Linux:
34+
# Ubuntu/Debian:
35+
$ apt-get install bash-completion
3736
38-
Install completion:
39-
$ kubectl-coco completion zsh > "${fpath[1]}/_kubectl-coco"
40-
$ exec zsh
37+
# CentOS/RHEL:
38+
$ yum install bash-completion
4139
42-
KUBECTL PLUGIN:
40+
Installation:
4341
44-
For 'kubectl coco' completion, install kubectl completion:
45-
$ kubectl completion bash > $(brew --prefix)/etc/bash_completion.d/kubectl
42+
For current session:
43+
$ source <(kubectl-coco completion bash)
44+
45+
For all sessions (permanent):
46+
# MacOS:
47+
$ kubectl-coco completion bash > $(brew --prefix)/etc/bash_completion.d/kubectl-coco
48+
49+
# Linux:
50+
$ kubectl-coco completion bash > /etc/bash_completion.d/kubectl-coco
51+
52+
# Then restart your shell
53+
54+
For kubectl plugin (kubectl coco):
55+
56+
Install kubectl completion first:
57+
# MacOS:
58+
$ kubectl completion bash > $(brew --prefix)/etc/bash_completion.d/kubectl
59+
60+
# Linux:
61+
$ kubectl completion bash > /etc/bash_completion.d/kubectl
62+
63+
ZSH
64+
65+
Enable completion if not already enabled:
66+
$ echo "autoload -U compinit; compinit" >> ~/.zshrc
67+
68+
Install kubectl-coco completion:
69+
$ kubectl-coco completion zsh > "${fpath[1]}/_kubectl-coco"
70+
71+
Start a new shell for completion to take effect.
4672
`,
4773
DisableFlagsInUseLine: true,
4874
ValidArgs: []string{"bash", "zsh"},

0 commit comments

Comments
 (0)