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 [email protected]:
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, <[email protected] <mailto:[email protected]>> wrote:

    Op 03-07-18 om 15:57 schreef [email protected]
    <mailto:[email protected]>:
    > 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
    [email protected] <mailto:[email protected]>
    https://lists.zx2c4.com/mailman/listinfo/password-store


_______________________________________________
Password-Store mailing list
[email protected]
https://lists.zx2c4.com/mailman/listinfo/password-store

Reply via email to