[pass] [PATCH v2] Don't require trailing slash in PASSWORD_STORE_DIR

Florian Margaine florian at margaine.com
Wed Oct 26 11:42:10 CEST 2016


This requirement leads to non-working bash completion in many cases,
with a lot of head-scratching.

This issue doesn't exist in fish and zsh where this is already done this
way.
---
 src/completion/pass.bash-completion | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/completion/pass.bash-completion
b/src/completion/pass.bash-completion index 456485b..f773d1d 100644
--- a/src/completion/pass.bash-completion
+++ b/src/completion/pass.bash-completion
@@ -5,13 +5,13 @@
 # This file is licensed under the GPLv2+. Please see COPYING for more
information. 
 _pass_complete_entries () {
-	prefix="${PASSWORD_STORE_DIR:-$HOME/.password-store/}"
+	prefix="${PASSWORD_STORE_DIR:-$HOME/.password-store}"
 	prefix="${prefix%/}/"
 	suffix=".gpg"
 	autoexpand=${1:-0}
 
 	local IFS=$'\n'
-	local items=($(compgen -f $prefix$cur))
+	local items=($(compgen -f $prefix/$cur))
 
 	# Remember the value of the first item, to see if it is a
directory. If # it is a directory, then don't add a space to the
completion
-- 
2.10.0

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 455 bytes
Desc: OpenPGP digital signature
URL: <http://lists.zx2c4.com/pipermail/password-store/attachments/20161026/a99b930c/attachment.asc>


More information about the Password-Store mailing list