diff options
author | Romain Gonçalves <me@rgoncalves.se> | 2021-12-23 18:28:03 +0000 |
---|---|---|
committer | Romain Gonçalves <me@rgoncalves.se> | 2021-12-23 18:28:03 +0000 |
commit | 0f08d04698c814955116b6bae50752e64b774d8f (patch) | |
tree | 8cf9a33557093eebfd25aab2872e97639c7e2f62 /.bin/show-pass | |
download | dots-0f08d04698c814955116b6bae50752e64b774d8f.tar.gz |
Thu Dec 23 06:28:03 PM UTC 2021
Diffstat (limited to '.bin/show-pass')
-rwxr-xr-x | .bin/show-pass | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/.bin/show-pass b/.bin/show-pass new file mode 100755 index 0000000..568570e --- /dev/null +++ b/.bin/show-pass @@ -0,0 +1,22 @@ +#!/bin/sh + +usage () { + cat >&2 <<-EOF + usage: ${0} password_regexp + EOF +} + +log () { + echo ["${0}"] $@ >&2 +} + +main() { + # verify arguments + [ "${#}" -ne 1 ] && usage && exit 1 + + # retrieve password + log "retrieving password for : ${1}" + gopass show --password $(gopass ls --flat | grep "${1}" | head -n 1) +} + +main $@ |