zsh completion: enhance store navigation

Wouter info at lsof.nl
Tue Jul 3 23:04:40 CEST 2018


I see, so what do you think about my patch? If the flag had a better 
name that is...

I do not really like how one flag causes two changes in behaviour, but 
if the name reflects that (e.g. 'alternative_completion') it might be okay.


Op 03-07-18 om 22:24 schreef yanchenko.igor at gmail.com:
> I wanted to make a solution that I can manage by flags, not by having 
> a separate _pass file, that's what I mean by elegant solution.
>
> On Tue 3 Jul 2018, 22:20 Wouter, <info at lsof.nl <mailto:info at lsof.nl>> 
> wrote:
>
>     Op 03-07-18 om 15:57 schreef yanchenko.igor at gmail.com
>     <mailto:yanchenko.igor at gmail.com>:
>     > Hi Wouter,
>     > I also prefer that behavior, I made a copy of _pass and did this
>     change:
>     >
>     > 127c127
>     > <       _files -W $prefix -g '*.gpg(:r)'
>     > ---
>     > >       _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#\\#\\\\#' | sort):-""}
>     >
>     > I didn't find more elegant solution.
>     Hi Igor,
>
>     Thank you, I actually like it. It's a rather clean solution isn't it?
>
>     I'd like to make it optional through zstyle so it can be enabled
>     without
>     breaking current behaviour. Maybe eventually it could then be
>     committed
>     to the repo. Something along the lines of this (although I had no
>     inspiration for a proper flag name):
>
>     19a20,24
>      > # By default, completed 'directories' within the store will not
>     have
>     a trailing
>      > # slash. Furthermore, the offered items will be looked up
>     recursively. To change
>      > # this, set the 'no_recurse' flag to true as follows:
>      > # `zstyle ':completion:*:*:pass:*' no_recurse true`.
>      >
>     127c132,137
>     <     _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#\\#\\\\#' | sort):-""}
>     ---
>      >     zstyle -t ':completion:*:*:pass:*' no_recurse
>      >     if [ $? -eq 0 ]; then
>      >         _files -W $prefix -g '*.gpg(:r)'
>      >     else
>      >         _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#\\#\\\\#' | sort):-""}
>      >     fi
>
>     Best regards,
>     Wouter
>     _______________________________________________
>     Password-Store mailing list
>     Password-Store at lists.zx2c4.com <mailto:Password-Store at lists.zx2c4.com>
>     https://lists.zx2c4.com/mailman/listinfo/password-store
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.zx2c4.com/pipermail/password-store/attachments/20180703/8c8e614f/attachment-0001.html>


More information about the Password-Store mailing list