Yerbacon/scripts/completions/bash-completion.sh

24 lines
677 B
Bash

# Bash autocomplete script for yerbacon
function YCompReply() { mapfile -t COMPREPLY <<< "$1"; }
_ybconAutoComplete() {
compopt +o default
local current previous options
COMPREPLY=()
current="${COMP_WORDS[COMP_CWORD]}"
previous="${COMP_WORDS[COMP_CWORD-1]}"
options='-h -p -t -o --help --parallel --target= --newlines= --printresult --text --output --version --buildInfo'
if [[ "${current}" == -* ]]; then
YCompReply "$(compgen -W "$options" -- "$current")"
return 0
else
case "${previous}" in
-h | --help | --version )
return 0 ;;
esac
complete -f -o plusdirs -X '!*.ybcon' ybcon
fi
}
complete -F _ybconAutoComplete ybcon