[pass] [PATCH] Add support for 'show -t/--tail' to print 2nd and subsequent lines

Von Welch von at vwelch.com
Sat Jul 5 02:31:46 CEST 2014

Hi guns,

 I'm not sure of your logic to arrive at why it "should" be done the way
you state, but I'll just point our you are re-implementing parts of the
logic of pass in the script wrapper (namely splitting the password from the
metadata, figuring out the right clipboard command). I like to avoid
repeating logic (DRY so to speak).

 To put it another way, I'll point out pass gives me a command to separate
out the password (-c/--clip), a complementary command to pull out the
metadata doesn't seem unreasonable.


On Fri, Jul 4, 2014 at 4:41 PM, guns <self at sungpae.com> wrote:

> On Fri  4 Jul 2014 at 07:16:36AM -0400, Von Welch wrote:
> > Thanks for chiming in. Yes, 'pass -c -t <store>' is basically my
> > default now, putting the password into the clipboard and all the
> > metadata to stdout. Once I had this ability, I find it's what I want
> > most of the time and it's benign the rest.
> This should be a one liner in your favorite scripting language:
> # GNU sed¹
> passc() {
>     pass "$@" | sed -ne '1p; 2,$w /dev/stderr' | clip-cmd
> }
> # Ruby
> passc() {
>     pass "$@" | ruby -e 'puts $stdin.gets; warn $stdin.read' | clip-cmd
> }
> The metadata is written to stderr instead of stdout, but the same effect
> is achieved.
>     guns
> ¹ Not implying sed is anyone's favorite scripting language
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.zx2c4.com/pipermail/password-store/attachments/20140704/b35dbc45/attachment-0001.html>

More information about the Password-Store mailing list