<html><head></head><body><div class="yahoo-style-wrap" style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:13px;"><div dir="ltr" data-setdir="false">Presented in a "slow refactor" series, and including extra tests, these patches support the following workflow to be able to work more ergonomically with lines and fields of password files.</div><div dir="ltr" data-setdir="false"><br></div><div dir="ltr" data-setdir="false">Basically, the first part is set up to split out "what are you trying to pull out of gpg?" and "how are you trying to display that to the user?".</div><div dir="ltr" data-setdir="false"><br></div><div dir="ltr" data-setdir="false">Once that split's been made, then it's a simple matter of adding --line, and --field support for "filtering", and then there's a few improvements made to allow --line or --field to be simply printed, copied to clipboard, etc.  The QR-Code patch has a dependency on the previous "YES_TTY" patch which I submitted previously.</div><div dir="ltr" data-setdir="false"><br></div><div dir="ltr" data-setdir="false">Hopefully it's clear about the ergonomics around this. The specific use case I was targeting was multi-value credentials (ie: S3 username, password, access-key, bucket-id, etc) which I wanted to be able to pull out the appropriate fields in a scriptable fashion. In order to do that, it was easier to fix the jumble of clipboard/qrcode/etc. before trying to add a new feature to it.</div><div dir="ltr" data-setdir="false"><br></div><div dir="ltr" data-setdir="false">`--clip` still maintains the ability to specify a line number for convenience and backwards compatibility, but the addition of `--line` is critical to segregate out `--clip` and `--qrcode` as two distinct output types.  That is to say: `--clip=2` and `--line=2 --clip` are equivalent, but `--line=2 --qrcode` and `--field=foo --clip` seem like incredibly important use cases (and are supported by this patch series).<br></div><div dir="ltr" data-setdir="false"><br></div><div dir="ltr" data-setdir="false"><span></span><span></span><div><font face=""courier new", courier, monaco, monospace, sans-serif">$ printf "hello\ntarget: world\n" | ./src/password-store.sh insert -m test<br>Enter contents of test and press Ctrl+D when finished:<br><br>[master fff1234] Add given password for test to store.<br> 1 file changed, 0 insertions(+), 0 deletions(-)<br> rewrite test.gpg (100%)<br>$ ./src/password-store.sh show test<br>hello<br>target: world<br>$ ./src/password-store.sh show test --line=2<br>target: world<br>$ ./src/password-store.sh show test --field=target<br></font><div><font face=""courier new", courier, monaco, monospace, sans-serif">world</font></div><div dir="ltr" data-setdir="false"><font face=""courier new", courier, monaco, monospace, sans-serif"><div>$ ./src/password-store.sh show test --field=target --clip && echo $( xclip -selection c -o )<br><div>world</div><div><font face=""courier new", courier, monaco, monospace, sans-serif">$ ./src/password-store.sh show test --field=target --qrcode | cat</font></div></div></font></div><div><font face=""courier new", courier, monaco, monospace, sans-serif">█████████████████████████████</font></div><font face=""courier new", courier, monaco, monospace, sans-serif">█████████████████████████████<br>████ ▄▄▄▄▄ █▀ █ ▄█ ▄▄▄▄▄ ████<br>████ █   █ █▄ █▀▄█ █   █ ████<br>████ █▄▄▄█ █ ██▀ █ █▄▄▄█ ████<br>████▄▄▄▄▄▄▄█ ▀ ▀ █▄▄▄▄▄▄▄████<br>████▄▄▀▄▀▀▄ █▄ ███ ▄▄█  ▀████<br>████ █  ▀▀▄▀▀▀█▀▄▄███ ██▄████<br>███████▄█▄▄▄ █▀▀▄█▄▀  █  ████<br>████ ▄▄▄▄▄ █▄▄ ▀▀ █ ▀▄█▄█████<br>████ █   █ █▀█▀ ██▄ ▄▀▀▀ ████<br>████ █▄▄▄█ █▀█▄█▄▀▀▀ █▄█▄████<br>████▄▄▄▄▄▄▄█▄▄▄▄▄██▄▄▄█▄█████<br>█████████████████████████████<br>█████████████████████████████</font><br><br></div><div><br></div></div></div></body></html>