hi. i put the following very small patch together for pass.bash-completion. it allows one to specify an environmental variable PASSWORD_COMPLETE_ENTRIES, which is shell code that is "eval"d. the default is (we hope) the current behavior. but, i, e.g., have in my .bashrc, the following: ---- export PASSWORD_COMPLETE_ENTRIES='(([[ -n ${COMPREPLY[@]} ]] && echo ${COMPREPLY[@]} | tr " " "\n"; (cd $prefix; find . -name "${cur}*.gpg" -type f | sed "sX./XX" | sed "s/[.]gpg//" ) ) 2>&1 | dmenu -b)' ---- which allows me to do completion via dmenu(1). possibly this would satisfy the "choose".
i barely know bash, so can't comment on how this would fit with fish, zsh completion. the only thing i'm a bit worried about is zeroing out "COMPREPLY" -- necessary for the code to work -- at the point i do. it *seems* as if "items" should contain everything one would want to have in "COMPREPLY". cheers, Greg ----
>From f5e4d5d34aec8b3e7ec6127993f87c305daf9f54 Mon Sep 17 00:00:00 2001 From: Greg Minshall <minsh...@acm.org> Date: Sun, 3 Jun 2018 19:21:55 -0700 Subject: [PATCH] PASSWORD_COMPLETE_ENTRIES (programmable programmable) --- src/completion/pass.bash-completion | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/completion/pass.bash-completion b/src/completion/pass.bash-completion index 456485b..f3ae5c3 100644 --- a/src/completion/pass.bash-completion +++ b/src/completion/pass.bash-completion @@ -9,9 +9,11 @@ _pass_complete_entries () { prefix="${prefix%/}/" suffix=".gpg" autoexpand=${1:-0} + local complete_entries=${PASSWORD_COMPLETE_ENTRIES:='compgen -f $prefix$cur'} local IFS=$'\n' - local items=($(compgen -f $prefix$cur)) + local items=($(eval ${complete_entries})) + COMPREPLY=() # presumably, items is everything # 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.7.4
_______________________________________________ Password-Store mailing list Password-Store@lists.zx2c4.com https://lists.zx2c4.com/mailman/listinfo/password-store