[pass] [PATCH 1/2] bashcomp: PASSWORD_STORE_DIR env var does not necessarily have a trailing slash

samuel.lethiec at intelunix.fr samuel.lethiec at intelunix.fr
Thu Apr 2 14:01:28 CEST 2015


 

Hello again! 

I did not get any feedback on this patch. Do I have a
issue others don't? Or, is the patch broken somehow? 

Thanks, 

Samuel


On 2015-03-01 22:23, samuel.lethiec at intelunix.fr wrote: 

> Hello,
>

> If PASSWORD_STORE_DIR does not end with a slash, bash completion is

> somewhat messed up:
> 
> $ pass[TAB]
> // edit generate grep...
> 
>
Here is a short patch which fixes it.
> 
> PS: hope my git foo is good
enough:)
> ---
> src/completion/pass.bash-completion | 2 ++
> 1 file
changed, 2 insertions(+)
> 
> diff --git
a/src/completion/pass.bash-completion 
>
b/src/completion/pass.bash-completion
> index ea31fbf..efd4b70 100644
>
--- a/src/completion/pass.bash-completion
> +++
b/src/completion/pass.bash-completion
> @@ -6,6 +6,7 @@
> 
>
_pass_complete_entries () {
>
prefix="${PASSWORD_STORE_DIR:-$HOME/.password-store/}"
> +
prefix="${prefix%/}/"
> suffix=".gpg"
> autoexpand=${1:-0}
> 
> @@ -42,6
+43,7 @@ _pass_complete_entries () {
> 
> _pass_complete_folders () {
>
prefix="${PASSWORD_STORE_DIR:-$HOME/.password-store/}"
> +
prefix="${prefix%/}/"
> 
> local IFS=$'n'
> local items=($(compgen -d
$prefix$cur))
> 
> _______________________________________________
>
Password-Store mailing list
> Password-Store at lists.zx2c4.com
>
http://lists.zx2c4.com/mailman/listinfo/password-store [1]




Links:
------
[1]
http://lists.zx2c4.com/mailman/listinfo/password-store
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.zx2c4.com/pipermail/password-store/attachments/20150402/53afab89/attachment.html>


More information about the Password-Store mailing list