Support shell auto-completion #2376
Labels
enhancement
New feature or request
priority-medium
Not functioning - next quarter if capacity permits
Stale
Is your feature or enhancement request related to a problem or limitation? Please describe
I wish that Tab auto-completion would be supported by Zowe CLI in popular shells like Bash and Zsh.
Describe your enhancement idea
Enable autocompletion in Zowe CLI with the
yargs.completion
API, which enables azowe completion
command to generate a shell script that can be added to~/.bashrc
or~/.zshrc
: https://yargs.js.org/docs/#api-reference-completioncmd-description-fnDescribe alternatives you've considered
I can launch web help to see command syntax, but this requires switching to a browser and is less context sensitive.
Provide any additional context
The configuration of Yargs for Zowe CLI happens in the YargsConfigurer class.
On MacOS the script generated by Yargs looks like this:
Note: The built-in autocompletion provided by Yargs works pretty well, but we may need to customize the
yargs.completion
handler to extract only the first line out of command descriptions, because multiple lines seem to mess it up.The text was updated successfully, but these errors were encountered: