mirror of
https://github.com/versity/versitygw.git
synced 2026-07-02 16:54:25 +00:00
14b0aabb0b
The urfave/cli/v2 has built-in auto-completion support for bash. This enables generating the auto completions with a cli option that can be added to environment setup scripts. Also adding some distro support scripts for rpm and deb for the auto completion setup. To enable auto completion in zsh, this still needs to be added to user .zshrc: fpath=(/usr/share/zsh/site-functions $fpath) autoload -Uz compinit && compinit Fixes #2015
14 lines
326 B
Bash
14 lines
326 B
Bash
#compdef versitygw
|
|
_versitygw() {
|
|
local -a opts
|
|
local cur
|
|
cur=${words[-1]}
|
|
if [[ "$cur" == "-"* ]]; then
|
|
opts=("${(@f)$(${words[1,-2]} ${cur} --generate-bash-completion)}")
|
|
else
|
|
opts=("${(@f)$(${words[1,-2]} --generate-bash-completion)}")
|
|
fi
|
|
_describe 'versitygw' opts
|
|
}
|
|
_versitygw
|