Add pass-unpack zsh function for easily retrieving all fields from a password-store file

This commit is contained in:
Danielle McLean 2017-05-10 14:46:54 +10:00
parent 79894affd5
commit 4704c050a2
Signed by: 00dani
GPG key ID: 5A5D2D1AFF12EEC5

View file

@ -0,0 +1,8 @@
#! zsh
local out=("${(@f)$(echo -n 'password: ' && pass show $1)}") field
for field in $out; do
field=(${(s/: /)field})
set -A $2 ${(kv)${(P)2}} $field
# Above is equivalent to $2+=($field) except it's legal syntax ;)
done