Crates.io | cli-completion |
lib.rs | cli-completion |
version | 0.4.0 |
source | src |
created_at | 2020-11-14 06:42:05.877214 |
updated_at | 2021-11-28 22:54:37.481932 |
description | cli completion for bash, zsh, fish and powershell. |
homepage | https://github.com/linux-china/cli-completion |
repository | https://github.com/linux-china/cli-completion |
max_upload_size | |
id | 312267 |
size | 477,364 |
CLI completion for bash, zsh, fish and powershell.
$ cargo install cli-completion
Please refer https://github.com/clap-rs/clap#using-yaml to write YAML file for the cli. Or you can refer multipass.yaml as an example.
$ cli-completion --bash commands/multipass.yaml
$ cli-completion --bash xxx.yaml > xxx-completion.sh
$ cli-completion --bash xxx.yaml > xxx-completion.fish
$ cli-completion --bash xxx.yaml > /usr/local/share/zsh/site-functions/_xxx
$ autoload -U compinit && compinit
$ mkdir ~/.oh-my-zsh/custom/plugins/xxx
$ cli-completion --zsh xxx.yaml > ~/.oh-my-zsh/custom/plugins/xxx/_xxx
Don't forget to enable xxx plugin in ~/.zshrc fileļ¼
$ cli-completion --powershell xxx.yaml > xxx-completion.ps