ramses0 at yahoo.com
Wed Apr 14 21:56:27 UTC 2021
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)
+ 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
... 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:
It's _crucial_ to support `pass ls | grep ...` and be able to show the full identifier for usage.
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:
> > 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
I think I'm going to have a small local fork and build RPMs with some
of these minor patches.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 2836 bytes
Desc: not available
More information about the Password-Store