diff options
-rw-r--r-- | bash/bashrc.d/pass.bash | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/bash/bashrc.d/pass.bash b/bash/bashrc.d/pass.bash index d60a6022..61550b9e 100644 --- a/bash/bashrc.d/pass.bash +++ b/bash/bashrc.d/pass.bash @@ -19,11 +19,9 @@ _pass() local word=${COMP_WORDS[COMP_CWORD]} local entry while read -d '' -r entry ; do - if [[ $entry && $entry == "$word"* ]] ; then + if [[ $entry == "$word"* ]] ; then COMPREPLY=("${COMPREPLY[@]}" "$entry") fi - - # This part provides the input to the while loop done < <( # Set shell options to expand globs the way we expect @@ -40,7 +38,9 @@ _pass() entries=("${entries[@]%.gpg}") # Print all the entries, null-delimited - printf '%s\0' "${entries[@]}" + if ((${#entries[@]})) ; then + printf '%s\0' "${entries[@]}" + fi ) } complete -F _pass pass |