Yerbacon/scripts/completions/bash-completion.sh
Username404 21137f5beb
Add a "--text" argument
Signed-off-by: Username404 <w.iron.zombie@gmail.com>
2022-04-21 23:31:02 +02:00

24 lines
665 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 --help --parallel --target= --newlines= --printresult --text --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