Add pass-unpack zsh function for easily retrieving all fields from a password-store file
This commit is contained in:
parent
79894affd5
commit
4704c050a2
1 changed files with 8 additions and 0 deletions
8
config/zsh/functions/pass-unpack
Normal file
8
config/zsh/functions/pass-unpack
Normal 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
|
Loading…
Reference in a new issue