15 lines
400 B
Plaintext
15 lines
400 B
Plaintext
function _miaou_bash {
|
|
local cur="${COMP_WORDS[COMP_CWORD]}"
|
|
if ((COMP_CWORD == 1)); then
|
|
if [[ $cur =~ ^- ]]; then
|
|
# compopt -o nospace
|
|
mapfile -t COMPREPLY < <(compgen -W "--doctor --self-upgrade --version --help --uninstall" -- "$cur")
|
|
else
|
|
compopt -o filenames
|
|
mapfile -t COMPREPLY < <(compgen -f -- "$cur")
|
|
fi
|
|
fi
|
|
}
|
|
|
|
complete -F _miaou_bash "miaou-bash"
|