How To
Summary
The document explains how to enable tab auto completion for the Cloud Pak for Security (CP4S) cpctl command-line tool.
Objective
Enable tab auto completion for the Cloud Pak for Security cpctl command-line tool for the bash shell environment.
This feature is also available for fish, powershell, and zsh environments.
Environment
The environment requires the Cloud Pak for Security cpctl tool already installed.
Refer to the additional links in this document.
Steps
- Enter the following command. Replace
<--CP4S-NAMESPACE-->with the namespace Cloud Pak for Security is installed under.
For Example:cpctl load -n <--CP4S-NAMESPACE-->cpctl load -n cp4s - Enter the following command. Replace
<--SHELL-FILENAME-->with the name of a shell file of your choice.
For Example:cpctl completion bash > <--SHELL-FILENAME-->cpctl completion bash > cpctl-complete.sh -
OPTION 1: Globally configuring tab auto-completion for all users' client sessions
If the /etc/bash_completion.d/ directory exists use the following command to copy the auto completion file to it. Replace
<--SHELL-FILENAME-->with the name of the newly created shell file.
For example:sudo cp <--SHELL-FILENAME--> /etc/bash_completion.d/sudo cp cpctl-complete.sh /etc/bash_completion.d/OPTION 2: Locally configuring tab auto-completion for a single user's client session
Edit the .bashrc file located under the root of the user's home directory and add the following line of text.
Replace <--SHELL-FILENAME--> with the name of the newly created shell file.
For example:. $HOME/<--SHELL-FILENAME-->. $HOME/cpctl-complete.sh - Ensure to start a new terminal session to enable tab auto-completion.
Additional Information
If any of the following error messages are encountered by using the cpctl load command, then try the following actions.
-
ACTION: Issue the command ensuring that the Cloud Pak for Security namespace is specified as shown in the previous example.Error: no pod in default available using label 'run=cp-serviceability'
-
ACTION: Make sure you are logged in to the cluster server command-line interface as an administrator.Error: pods is forbidden: User "system:anonymous" cannot list resource "pods" in API group "" in the namespace "default"
Related Information
Document Location
Worldwide
[{"Type":"MASTER","Line of Business":{"code":"LOB24","label":"Security Software"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Product":{"code":"SSTDPP","label":"IBM Cloud Pak for Security"},"ARM Category":[{"code":"a8m0z000000Xat9AAC","label":"Documentation"}],"ARM Case Number":"","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"1.5.0;and future releases"}]
Was this topic helpful?
Document Information
Modified date:
21 February 2023
UID
ibm16552214