이 콘텐츠는 선택한 언어로 제공되지 않습니다.
Chapter 3. Configuring the OpenShift CLI
Configure OpenShift CLI (oc) based on your preferences for working with it.
3.1. Enabling tab completion 링크 복사링크가 클립보드에 복사되었습니다!
You can enable tab completion for the Bash or Zsh shells.
3.1.1. Enabling tab completion for Bash 링크 복사링크가 클립보드에 복사되었습니다!
After you install the OpenShift CLI (oc), you can enable tab completion to automatically complete oc commands or suggest options when you press Tab. The following procedure enables tab completion for the Bash shell.
Prerequisites
-
You must have the OpenShift CLI (
oc) installed. -
You must have the package
bash-completioninstalled.
Procedure
Save the Bash completion code to a file:
$ oc completion bash > oc_bash_completionCopy the file to
/etc/bash_completion.d/:$ sudo cp oc_bash_completion /etc/bash_completion.d/You can also save the file to a local directory and source it from your
.bashrcfile instead. Tab completion is enabled when you open a new terminal.
3.1.2. Enabling tab completion for Zsh 링크 복사링크가 클립보드에 복사되었습니다!
After you install the OpenShift CLI (oc), you can enable tab completion to automatically complete oc commands or suggest options when you press Tab. The following procedure enables tab completion for the Zsh shell.
Prerequisites
-
You must have the OpenShift CLI (
oc) installed.
Procedure
To add tab completion for
octo your.zshrcfile, run the following command:$ cat >>~/.zshrc<<EOF autoload -Uz compinit compinit if [ $commands[oc] ]; then source <(oc completion zsh) compdef _oc oc fi EOFTab completion is enabled when you open a new terminal.