1#!/bin/sh -x
2
3set --
4
5gopass ls --flat | emenu | xargs --no-run-if-empty gopass show | {
6 while IFS=': ' read -r k v; do case "$v" in
7 '') set -- "$@" password "$k" ;;
8 *) set -- "$@" "$k" "$v" ;;
9 esac; done
10
11 get_prop="$(printf '%s\n' "$(
12 until [ $# = 0 ]; do echo $1; shift 2; done
13 )" | emenu)"
14
15 until [ $# = 0 ]; do case "$1" in
16 "$get_prop") echo "$2"; break ;;
17 esac; shift 2; done
18}