c52818c03d
This is the first step to rename 'zh' to 'zh-cn'. There are several reasons why we rename the language name.
- The upstream docsy theme changed the language name, leading to many warnings during site build;
The side-effect is that the i18n strings are no longer working.
- We believe renaming the language is the right thing to do, because this move can make room for other variants of Chinese language, such as 'zh-tw', 'zh-sg' etc.
There would be several follow-ups to this PR, such as fixing the intra-site links, adding redirects etc.
We will lock up changes to zh/zh-cn pages for the moment, until this one gets in.
This PR is based on commit cdad0a7342.
4.5 KiB
4.5 KiB
为指定 Shell(Bash 或 Zsh) 输出 Shell 补全代码
概要
为指定的 shell(bash 或 zsh)输出 shell 自动补全代码。 必须激活 shell 代码以提供交互式 kubeadm 命令补全。这可以通过加载 .bash_profile 文件完成。
注意: 此功能依赖于 bash-completion 框架。
在 Mac 上使用 homebrew 安装:
brew install bash-completion
安装后,必须激活 bash_completion。这可以通过在 .bash_profile 文件中添加下面的命令行来完成
source $(brew --prefix)/etc/bash_completion
如果在 Linux 上没有安装 bash-completion,请通过你的发行版的包管理器安装 bash-completion 软件包。
zsh 用户注意事项:[1] zsh 自动补全仅在 >=v5.2 及以上版本中支持。
kubeadm completion SHELL [flags]
示例
# 在 Mac 上使用 homebrew 安装 bash completion
brew install bash-completion
printf "\n# Bash completion support\nsource $(brew --prefix)/etc/bash_completion\n" >> $HOME/.bash_profile
source $HOME/.bash_profile
# 将 bash 版本的 kubeadm 自动补全代码加载到当前 shell 中
source <(kubeadm completion bash)
# 将 bash 自动补全完成代码写入文件并且从 .bash_profile 文件加载它
printf "\n# Kubeadm shell completion\nsource '$HOME/.kube/kubeadm_completion.bash.inc'\n" >> $HOME/.bash_profile
source $HOME/.bash_profile
# 将 zsh 版本的 kubeadm 自动补全代码加载到当前 shell 中
source <(kubeadm completion zsh)
选项
| -h, --help | |
|
completion 操作的帮助命令 |
|
从父命令继承的选项
| --rootfs string | |
|
[实验] 到 '真实' 主机根文件系统的路径。 |
|