diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2015-06-06 14:54:33 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2015-06-06 14:54:33 +1200 |
commit | fdfe1fe72f8fe358d2b64ddc9e1b58dda4d3ba90 (patch) | |
tree | 75374be5bee4e0f36f3020958fb99e8fb46e4385 /bash/bashrc.d/pass.bash | |
parent | Avoid command substitution inline declaration (diff) | |
download | dotfiles-fdfe1fe72f8fe358d2b64ddc9e1b58dda4d3ba90.tar.gz dotfiles-fdfe1fe72f8fe358d2b64ddc9e1b58dda4d3ba90.zip |
Separate declaration from assignment
Diffstat (limited to 'bash/bashrc.d/pass.bash')
-rw-r--r-- | bash/bashrc.d/pass.bash | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/bash/bashrc.d/pass.bash b/bash/bashrc.d/pass.bash index e173531f..d40a833f 100644 --- a/bash/bashrc.d/pass.bash +++ b/bash/bashrc.d/pass.bash @@ -8,7 +8,8 @@ fi _pass() { # If we can't read the password directory, just bail - local passdir=${PASSWORD_STORE_DIR:-$HOME/.password-store} + local passdir + passdir=${PASSWORD_STORE_DIR:-$HOME/.password-store} if [[ ! -r $passdir ]] ; then return 1 fi @@ -16,8 +17,8 @@ _pass() # Iterate through list of .gpg paths, extension stripped, null-delimited, # and filter them down to the ones matching the completing word (compgen # doesn't seem to do this properly with a null delimiter) - local word=${COMP_WORDS[COMP_CWORD]} - local entry + local word entry + word=${COMP_WORDS[COMP_CWORD]} while read -d '' -r entry ; do if [[ $entry == "$word"* ]] ; then COMPREPLY=("${COMPREPLY[@]}" "$entry") |