pass list

Pierre Prinetti pierreprinetti at redhat.com
Thu Apr 15 07:51:19 UTC 2021


@ robert:
Thank you, your patch is better than mine. And indeed, not adding
flags is even better. Added locally, FWIW :)

On Thu, 15 Apr 2021 at 00:01, Robert Ames <ramses0 at yahoo.com> wrote:
>
> Detect TTY (interactive status):
> +[[ -t 1 ]] && YES_TTY=1
>
> If NO_TTY, use find + sed as suggested, else keep the existing "Tree" command:
> -        tree -C -l --noreport "$PREFIX/$path" | tail -n +2 | sed -E 's/\.gpg(\x1B\[[0-9]+m)?( ->|$)/\1\2/g' # remove .gpg at end of line, but keep colors
> +        if [[ -z $YES_TTY ]] ; then
> +            find "$PREFIX/$path" -type f -iname \*.gpg | sed -e 's/\.gpg$//g' -e "s,^$PREFIX,,g" -e 's/^\///g' # when non-interactive (pipeline) print full-path-per-entry (for easy copy/paste or filtering)
> +        else
> +            tree -C -l --noreport "$PREFIX/$path" | tail -n +2 | sed -E 's/\.gpg(\x1B\[[0-9]+m)?( ->|$)/\1\2/g' # remove .gpg at end of line, but keep colors
> +        fi
>
> ... at Dacoda... yep, "naive find" was what I came up with in 2019.
>
> Other password managers change behaviour slightly when running in a TTY/NO_TTY context:
> https://github.com/lastpass/lastpass-cli/blob/2a70884ed7ef48a8d621687acb96202cc354245b/cmd-ls.c#L287-L288
>
> It's _crucial_ to support `pass ls | grep ...` and be able to show the full identifier for usage.
>
> --Robert
>
>
>
> On Wednesday, April 14, 2021, 08:20:36 AM PDT, Dacoda Strack <dacoda.strack at gmail.com> wrote:
>
>
>
>
>
> On Wed, Apr 14, 2021 at 04:01:50PM +0300, Greg Minshall wrote:
>
> > Pierre,
> >
> > > I am willing to write a patch if we find consensus.
> >
> > i'd be a fan.  and, if highlighting could somehow also be controlled,
> > that would be great.
> >
> > cheers, Greg
>
>
> This sounds great to me, I wonder if something naive like
>
> find $PASSWORD_STORE -type f -name '*.gpg'
>
> with some additional sed to clean up the path would get us where we need
> to be
>
> I think I'm going to have a small local fork and build RPMs with some
> of these minor patches.
>



More information about the Password-Store mailing list