Enabling command completion¶
Command completion provides a way of completing the hubcli command when you're not sure of the keywords in the command.
For example, you could start a command, such as hubcli namespace,
and then press the tab key repeatedly to cycle through keywords until the one you require is displayed.
To get completion suggestions for the hubcli command itself, you press the tab key twice.
To enable command completion, you need to create a script which is then used by the command.
You do this using the hubcli completion command. For example, for Linux:
hubcli completion bash > outfile.txt
This writes the script to the specified file.
You then enter:
hubcli completion bash < outfile.txt
This reads the script from the specified file and ensures that the current commands and keywords from the latest version of hubcli are available for autocompletion.
If you want to get completion suggestions for the hubcli command itself, you have to press the Tab key twice.
The format of the hubcli completion command depends on the operating system shell for which you want to enable command completion.
Use the -h flag to get help for each of the available shells.
hubcli completion -h lists the commands that can be used,
and the options for a shell can seen by using, for example, hubcli completion bash -h.