summaryrefslogtreecommitdiffstats
path: root/.bin/show-pass
diff options
context:
space:
mode:
Diffstat (limited to '.bin/show-pass')
-rwxr-xr-x.bin/show-pass22
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 $@
remember that computers suck.