summaryrefslogtreecommitdiffstats
path: root/.bin/show-pass
blob: 568570e0a7f95f3ed35979563798ac9f0014bd68 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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.