<div dir="ltr">Matthew,<div><br></div><div> Reasonable enough. Revised patch attached.</div><div><br></div><div> I added some further indentation of the subcommand for readability.</div><div><br></div><div>Von</div><div><br>

</div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Feb 13, 2014 at 9:03 PM, Matthew Cengia <span dir="ltr"><<a href="mailto:mattcen@gmail.com" target="_blank">mattcen@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">On 2014-02-13 20:02, Von Welch wrote:<br>
> Hi,<br>
><br>
>  I'm said author of the -tail. I'll just add one thing about --tail to what<br>
> Jonas and Philip have said and that it works intelligently with -c, so '-t'<br>
> along doesn't put anything to the paste buffer but '-c -t' does. That's<br>
> logic much easier to add inside of password store than outside of it (and<br>
> yes, for those not running an agent, I do it with only one decryption).<br>
><br>
>  As a side note, I'm always loath to run 'pass' without -c because I'm not<br>
> convinced I can actually clear my screen well enough being that I'm running<br>
> in tmux inside of iTerm, and just too many things that can cache my output.<br>
> Putting passwords to stdout is last resort for me.<br>
<br>
</div>Hi Von,<br>
<br>
That all makes sense, thanks for the info.<br>
<br>
I see 2 problems with your code, specifically line 221:<br>
<br>
1.  It doesn't handle passwords that contain a backslash, because you're<br>
    not using read -r:<br>
<br>
      $ read pass <<<'9g+:em3b\Vixp:PK'<br>
      $ echo "$pass"<br>
      9g+:em3bVixp:PK<br>
      $ read -r pass <<<'9g+:em3b\Vixp:PK'<br>
      $ echo "$pass"<br>
      9g+:em3b\Vixp:PK<br>
<br>
2.  Stylistically, I think the line is too long. I'd rewrite line 221<br>
    as:<br>
<br>
    gpg2 -d $GPG_OPTS "$passfile" | { read -r pass<br>
    [[ -n $pass ]] || exit 1<br>
    clip "$pass" "$path"<br>
    [[ $tail -eq 1 ]] && cat ; }<br>
<br>
    This is far easier to read as a diff, as it's clear to see that the<br>
    middle 2 lines above haven't changed.<br>
<br>
Other than that, I like your patch.<br>
<span class="HOEnZb"><font color="#888888"><br>
<br>
--<br>
Regards,<br>
Matthew Cengia<br>
</font></span></blockquote></div><br></div>