[PATCH 1/1] bash completion without relying on /etc/bash-completion.d

Oliver Albertini oliver.ruben at gmail.com
Sat Feb 2 19:22:47 CET 2019


> > +                       if [[ -f $file ]]; then
> > +                               file=${file##*/};
>
> Missing quotes.

Word splitting is not done on assignment or inside [[ ]], so I don't think quotes are necessary.

> > +# COMPREPLY+=($(compgen -W "-o --option" -- ${cur}))
>
> Does cur need quotes? What's the norm for this file in that idiom?

cur should be quoted, but if the author is relying on word splitting to pass args to compgen, it would be better to put those words in an array and quote the array: "${curr[@]}"

> > +                               _source_extension_completion ${COMP_WORDS[1]}
> > +                               ;;
>
> Missing quotes?

Should be quoted.

--
Oliver Albertini


More information about the Password-Store mailing list