[PATCH] Add option --flat

Andreas Kölbl koelblandreas at freenet.de
Wed Jul 20 08:31:54 UTC 2022


Hello,

as I'm unsure, if compatibility is the aim of the project. The commit 
before on this line aimed to be compatible with tree 2.0 [1]. Since find 
and grep is already a dependency, sure I provide a version without tree.
I adapted the change, left sort out as this could be unintended use and 
appended suffix-removal after the first command.

There are similar approaches with the aim to be POSIX-compatible [2]. 
Anyways, I'm unsure if they have the same wiede adoption and mass of 
compatible clients.

But to allow different behavior here could be a compatible workaround. 
Any further suggestions are well appreciated.

Kind Regards
Andreas

[1] 
https://git.zx2c4.com/password-store/commit/?id=eea24967a002a2a81ae9b97a1fe972b5287f3a09
[2] https://github.com/dylanaraps/pash

Am 19.07.22 um 12:06 schrieb Kjetil Torgrim Homme:
> On 19/07/2022 11:37, Magnus Sandberg wrote:
>> Hi,
>>
>> After a few minutes of manual testing at my shell prompt, I guess 
>> this one does the same;
>>
>> find ${PREFIX} -type f -name '*.gpg' | grep -i "${terms}" \
>>     | sed -E "s|^${PREFIX}/||" | sed -E 's/\.gpg$//' | sort
>>
>>
>>
>> Assuming that 'grep -i "${terms}"' would give the same result as
>> 'tree ... -P "${terms%|*}" ...'
>
> I would prefer a version which is not reliant on tree, too. especially 
> since it seems very fragile to try to remove the glyphs used for the 
> tree in the output.  (in fact, on my EL7 box, the version of tree 
> shipped with the distro is incompatible with pass, so I run find(1) 
> manually instead!)
>
> A small point - I think it is better to remove the prefix and .gpg 
> suffix before the grep to avoid unwanted matches (e.g., searching for 
> "home" :)
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Add-option-flat.patch
Type: text/x-patch
Size: 2167 bytes
Desc: not available
URL: <http://lists.zx2c4.com/pipermail/password-store/attachments/20220720/a72f8ef1/attachment.bin>


More information about the Password-Store mailing list