/usr/share/bash-completion/completions/0install is in zeroinstall-injector 2.3.3-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | _0install_completion() {
local c IFS=$'\n'
COMPREPLY=()
local TO_FILTER=()
local WORD=${COMP_WORDS[$COMP_CWORD]}
if [ "$WORD" == "=" ]; then
WORD=""
fi
local RESULTS=$(COMP_CWORD=$COMP_CWORD ${COMP_WORDS[0]} _complete bash "${COMP_WORDS[@]}")
while read item
do
#echo "item>$item<" >&2
case "$item" in
add\ *) COMPREPLY=(${COMPREPLY[@]} ${item/#add /}) ;;
filter\ *) TO_FILTER=(${TO_FILTER[@]} ${item/#filter /}) ;;
prefix\ *) COMPREPLY=(${COMPREPLY[@]} ${item/#prefix /}) ;;
file) COMPREPLY=(${COMPREPLY[@]} $(compgen -A file "$WORD")) ;;
"") ;;
*) echo 1>&2 Bad reply $item ;;
esac
done <<< "$RESULTS"
if (( ${#TO_FILTER[@]} > 0 )); then
COMPREPLY=( ${COMPREPLY[@]} $(compgen -W "${TO_FILTER[*]}" -- "$WORD" ) )
fi
}
complete -o nospace -F _0install_completion 0install
|