2019-02-22 08:49:56 -05:00
|
|
|
// Module included in the following assemblies:
|
|
|
|
|
//
|
2019-10-02 11:30:49 -04:00
|
|
|
// * cli_reference/openshift_cli/configuring-cli.adoc
|
2019-02-22 08:49:56 -05:00
|
|
|
|
2019-05-13 08:55:00 +10:00
|
|
|
[id="cli-enabling-tab-completion_{context}"]
|
2019-02-22 08:49:56 -05:00
|
|
|
= Enabling tab 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.
|
|
|
|
|
|
|
|
|
|
.Prerequisites
|
|
|
|
|
|
|
|
|
|
* You must have the `oc` CLI tool installed.
|
|
|
|
|
|
|
|
|
|
.Procedure
|
|
|
|
|
|
|
|
|
|
The following procedure enables tab completion for Bash.
|
|
|
|
|
|
|
|
|
|
. Save the Bash completion code to a file.
|
|
|
|
|
+
|
2020-08-04 22:42:35 -04:00
|
|
|
[source,terminal]
|
2019-02-22 08:49:56 -05:00
|
|
|
----
|
|
|
|
|
$ oc completion bash > oc_bash_completion
|
|
|
|
|
----
|
|
|
|
|
|
|
|
|
|
. Copy the file to `/etc/bash_completion.d/`.
|
|
|
|
|
+
|
2020-08-04 22:42:35 -04:00
|
|
|
[source,terminal]
|
2019-02-22 08:49:56 -05:00
|
|
|
----
|
|
|
|
|
$ 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.
|