File tree Expand file tree Collapse file tree 1 file changed +4
-9
lines changed
content/zh/docs/tasks/tools/included Expand file tree Collapse file tree 1 file changed +4
-9
lines changed Original file line number Diff line number Diff line change @@ -26,24 +26,19 @@ source <(kubectl completion zsh)
26
26
```
27
27
28
28
<!--
29
- If you have an alias for kubectl, you can extend shell completion to work with that alias:
29
+ If you have an alias for kubectl, kubectl autocompletion will automatically work with it.
30
30
-->
31
- 如果你为 kubectl 定义了别名,可以扩展脚本补全,以兼容该别名。
32
-
33
- ``` zsh
34
- echo ' alias k=kubectl' >> ~/.zshrc
35
- echo ' compdef __start_kubectl k' >> ~/.zshrc
36
- ```
31
+ 如果你为 kubectl 定义了别名,kubectl 自动补全将自动使用它。
37
32
38
33
<!--
39
34
After reloading your shell, kubectl autocompletion should be working.
40
35
41
36
If you get an error like `complete:13: command not found: compdef`, then add the following to the beginning of your `~/.zshrc` file:
37
+ If you get an error like `2: command not found: compdef`, then add the following to the beginning of your `~/.zshrc` file:
42
38
-->
43
39
重新加载 shell 后,kubectl 自动补全功能将立即生效。
44
40
45
- 如果你收到 ` complete:13: command not found: compdef ` 这样的错误提示,那请将下面内容添加到 ` ~/.zshrc ` 文件的开头:
46
-
41
+ 如果你收到 ` 2: command not found: compdef ` 这样的错误提示,那请将下面内容添加到 ` ~/.zshrc ` 文件的开头:
47
42
``` zsh
48
43
autoload -Uz compinit
49
44
compinit
You can’t perform that action at this time.
0 commit comments