$ oc completion bash > oc_bash_completion
After you install the oc
CLI tool, you can enable tab completion to
automatically complete oc
commands or suggest options when you press Tab.
You must have the oc
CLI tool installed.
You must have the package bash-completion
installed.
The following procedure enables tab completion for Bash.
Save the Bash completion code to a file.
$ oc completion bash > oc_bash_completion
Copy 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
.bashrc
file instead.
Tab completion is enabled when you open a new terminal.