diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2015-10-21 14:41:24 +1300 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2015-10-21 14:41:24 +1300 |
commit | b64d99295e802b10c734de0dfed407ee093548a5 (patch) | |
tree | 8a3d4dfcae520c08f875094ebf398ea8d104b5a8 | |
parent | Fix another comment typo (diff) | |
download | dotfiles-b64d99295e802b10c734de0dfed407ee093548a5.tar.gz dotfiles-b64d99295e802b10c734de0dfed407ee093548a5.zip |
Remove directory change from pass completion
-rw-r--r-- | bash/bashrc.d/pass.bash | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/bash/bashrc.d/pass.bash b/bash/bashrc.d/pass.bash index e2bc20fc..91d2d538 100644 --- a/bash/bashrc.d/pass.bash +++ b/bash/bashrc.d/pass.bash @@ -26,12 +26,11 @@ _pass() shopt -u dotglob shopt -s globstar nullglob - # Change into password directory, or bail - cd -- "$passdir" 2>/dev/null || exit - # Gather the entries and remove their .gpg suffix declare -a entries - entries=("${COMP_WORDS[COMP_CWORD]}"*/**/*.gpg "${COMP_WORDS[COMP_CWORD]}"*.gpg) + entries=("$passdir"/"${COMP_WORDS[COMP_CWORD]}"*/**/*.gpg \ + "$passdir"/"${COMP_WORDS[COMP_CWORD]}"*.gpg) + entries=("${entries[@]#$passdir/}") entries=("${entries[@]%.gpg}") # Bail if no entries to prevent empty output |