diff --git a/config/zsh/functions/pass-unpack b/config/zsh/functions/pass-unpack new file mode 100644 index 0000000..e16986e --- /dev/null +++ b/config/zsh/functions/pass-unpack @@ -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