[PATCH] Small fixes in bash and zsh completion

simon.blum at posteo.org simon.blum at posteo.org
Wed Nov 30 22:32:14 UTC 2022


From: Simon Blum <simon.blum at posteo.org>

Bash completion didn't list -c and --clip after "pass <TAB>" which is
inconsistent with "pass show <TAB>". Zsh completion did not ignore
.gitattribute and .gitignore files in password-store.
---
 src/completion/pass.bash-completion | 1 +
 src/completion/pass.zsh-completion  | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/completion/pass.bash-completion b/src/completion/pass.bash-completion
index 2d23cbf..5e4d987 100644
--- a/src/completion/pass.bash-completion
+++ b/src/completion/pass.bash-completion
@@ -137,6 +137,7 @@ _pass()
 		fi
 	else
 		COMPREPLY+=($(compgen -W "${commands}" -- ${cur}))
+		COMPREPLY+=($(compgen -W "-c --clip" -- ${cur}))
 		_pass_complete_entries 1
 	fi
 }
diff --git a/src/completion/pass.zsh-completion b/src/completion/pass.zsh-completion
index d911e12..1273ab6 100644
--- a/src/completion/pass.zsh-completion
+++ b/src/completion/pass.zsh-completion
@@ -124,7 +124,7 @@ _pass_complete_entries_helper () {
 	local IFS=$'\n'
 	local prefix
 	zstyle -s ":completion:${curcontext}:" prefix prefix || prefix="${PASSWORD_STORE_DIR:-$HOME/.password-store}"
-	_values -C 'passwords' ${$(find -L "$prefix" \( -name .git -o -name .gpg-id \) -prune -o $@ -print 2>/dev/null | sed -e "s#${prefix}/\{0,1\}##" -e 's#\.gpg##' -e 's#\\#\\\\#g' -e 's#:#\\:#g' | sort):-""}
+	_values -C 'passwords' ${$(find -L "$prefix" \( -name ".git*" -o -name .gpg-id \) -prune -o $@ -print 2>/dev/null | sed -e "s#${prefix}/\{0,1\}##" -e 's#\.gpg##' -e 's#\\#\\\\#g' -e 's#:#\\:#g' | sort):-""}
 }
 
 _pass_complete_entries_with_subdirs () {
-- 
2.38.1



More information about the Password-Store mailing list