Patching pass to accept a line number with show isn't much work. I've included

a patch (as attachment, because I don't trust my webmail to not mangle it),
which adds -nN and --line=N (with N being the line number) to only show a
specific line. (Maybe this could be merged? It would be useful in a lot of
cases)

Till Schäfer <[email protected]> schrieb am 11:49 Freitag, 
24.November 2017:



Hi, 
you can  also just use the show command and pipe it through the standard tool 
chain of your shell. If you are using X, you can then pipe it to the X 
clipboard via xclip. 

pass show XYZ | head -n 1 | tr -d '\n' | sed 's/ //g' |  xclip -selection 
clipboard

A little bit formatting noise, but it works. It would be nice to directly 
specify the line, which should be shown by pass show. 

Regards, 
Till

Am Donnerstag, 23. November 2017, 23:42:26 CET schrieb Greg Minshall:
> hi.  pass make me very happy -- thanks very much!
> 
> my basic, silly, use case, is credit card numbers.  i like to store them
> with spaces separating groups of 4 digits ("1234 5678 9012 3456"), but
> web sites typically want them space-free.  so, in *this* case, i'd like
> to pass them through "sed 's/ //g'" on the way to the clipboard.
> 
> in general, it might be nice to allow some arbitrary filter to be
> inserted, maybe where "pass" is set in cmd_show?  (where it would apply
> with or without -c.)  (though some more specific thing, like an option
> to exclude spaces, would likely be more secure, so...)
> 
> i don't think that can be done as an add-on (without duplicating all of
> cmd_show, i'd guess).
> 
> cheers, and again thanks, Greg Minshall
> _______________________________________________
> Password-Store mailing list
> [email protected]
> https://lists.zx2c4.com/mailman/listinfo/password-store
> 
-- 
Dipl.-Inf. Till Schäfer
TU Dortmund University
Chair 11 - Algorithm Engineering
Otto-Hahn-Str. 14 / Room 237
44227 Dortmund, Germany

e-mail: [email protected]
phone: +49(231)755-7706
fax: +49(231)755-7740
web: http://ls11-www.cs.uni-dortmund.de/staff/schaefer
pgp: 
https://keyserver2.pgp.com/vkd/SubmitSearch.event?&&SearchCriteria=0xD84DED79

_______________________________________________
Password-Store mailing list
[email protected]
https://lists.zx2c4.com/mailman/listinfo/password-store
349c349
< 	opts="$($GETOPT -o q::c:: -l qrcode::,clip:: -n "$PROGRAM" -- "$@")"
---
> 	opts="$($GETOPT -o q::c::n: -l qrcode::,clip::,line: -n "$PROGRAM" -- "$@")"
354a355
> 		-n|--line) selected_line=$2; shift 2 ;;
358c359
< 	[[ $err -ne 0 || ( $qrcode -eq 1 && $clip -eq 1 ) ]] && die "Usage: $PROGRAM $COMMAND [--clip[=line-number],-c[line-number]] [--qrcode[=line-number],-q[line-number]] [pass-name]"
---
> 	[[ $err -ne 0 || ( $qrcode -eq 1 && $clip -eq 1 ) ]] && die "Usage: $PROGRAM $COMMAND [--clip[=line-number],-c[line-number]] [--qrcode[=line-number],-q[line-number]] [--line[=line-number],-n[line-number]] [pass-name]"
364c365
< 		if [[ $clip -eq 0 && $qrcode -eq 0 ]]; then
---
> 		if [[ -z "$selected_line" ]]; then
373a375,376
> 			else
> 				echo "$pass"
_______________________________________________
Password-Store mailing list
[email protected]
https://lists.zx2c4.com/mailman/listinfo/password-store

Reply via email to