Discard completion errors

This commit is contained in:
Mateo FERON 2020-04-14 11:34:11 +02:00
parent 1c3d5d2dcf
commit 1556501efd

View file

@ -7,10 +7,10 @@ _zpkg_completion()
_cw1_file="deploy"
if [ "$COMP_CWORD" = "1" ] ; then
_compwords=$_cw1
elif [ "$COMP_CWORD" -gt "1" ] && [ -n "$(echo "$_cw1_pkgw" | grep -w "${COMP_WORDS[1]}")" ] ; then
_compwords=$(zpkg list-all)
elif [ "$COMP_CWORD" -gt "1" ] && [ -n "$(echo "$_cw1_pkgw" | grep -w "${COMP_WORDS[1]}" 2>/dev/null)" ] ; then
_compwords=$(zpkg list-all 2>/dev/null)
fi
COMPREPLY=($(compgen -W "$_compwords" "${COMP_WORDS[$COMP_CWORD]}"))
COMPREPLY=($(compgen -W "$_compwords" "${COMP_WORDS[$COMP_CWORD]}" 2>/dev/null))
}
complete -F _zpkg_completion -o dirnames zpkg