[pass] Patch for adding a multiclip option

Von Welch von at vwelch.com
Fri Feb 14 04:40:40 CET 2014


Matthew,

 Reasonable enough. Revised patch attached.

 I added some further indentation of the subcommand for readability.

Von




On Thu, Feb 13, 2014 at 9:03 PM, Matthew Cengia <mattcen at gmail.com> wrote:

> On 2014-02-13 20:02, Von Welch wrote:
> > Hi,
> >
> >  I'm said author of the -tail. I'll just add one thing about --tail to
> what
> > Jonas and Philip have said and that it works intelligently with -c, so
> '-t'
> > along doesn't put anything to the paste buffer but '-c -t' does. That's
> > logic much easier to add inside of password store than outside of it (and
> > yes, for those not running an agent, I do it with only one decryption).
> >
> >  As a side note, I'm always loath to run 'pass' without -c because I'm
> not
> > convinced I can actually clear my screen well enough being that I'm
> running
> > in tmux inside of iTerm, and just too many things that can cache my
> output.
> > Putting passwords to stdout is last resort for me.
>
> Hi Von,
>
> That all makes sense, thanks for the info.
>
> I see 2 problems with your code, specifically line 221:
>
> 1.  It doesn't handle passwords that contain a backslash, because you're
>     not using read -r:
>
>       $ read pass <<<'9g+:em3b\Vixp:PK'
>       $ echo "$pass"
>       9g+:em3bVixp:PK
>       $ read -r pass <<<'9g+:em3b\Vixp:PK'
>       $ echo "$pass"
>       9g+:em3b\Vixp:PK
>
> 2.  Stylistically, I think the line is too long. I'd rewrite line 221
>     as:
>
>     gpg2 -d $GPG_OPTS "$passfile" | { read -r pass
>     [[ -n $pass ]] || exit 1
>     clip "$pass" "$path"
>     [[ $tail -eq 1 ]] && cat ; }
>
>     This is far easier to read as a diff, as it's clear to see that the
>     middle 2 lines above haven't changed.
>
> Other than that, I like your patch.
>
>
> --
> Regards,
> Matthew Cengia
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.zx2c4.com/pipermail/password-store/attachments/20140213/0f2b6731/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Add-support-for-show-t-tail-to-print-2nd-and-subsequ.patch
Type: application/octet-stream
Size: 3130 bytes
Desc: not available
URL: <http://lists.zx2c4.com/pipermail/password-store/attachments/20140213/0f2b6731/attachment.obj>


More information about the Password-Store mailing list