credentials: remove -r

It's pointless now with sekrit cp.
This commit is contained in:
Lucas 2020-05-25 15:19:01 +00:00
parent 1d45d3c561
commit a830563ebd

View File

@ -15,7 +15,6 @@ usage()
cat - <<. >&2
Usage:
${0##*/} [-2pu] service
${0##*/} -r key
.
exit 1
}
@ -90,28 +89,15 @@ get_service()
[ $sfa = yes ] && get_2fa "$service"
}
get_raw()
{
key=$1
sekrit has "$key" || err "unknown key $key"
printf "%s" "$key"
sekrit get "$key" | clip && printf "\n"
}
sfa=no
pass=no
raw=no
user=no
while getopts 2pru flag; do
while getopts 2pu flag; do
case $flag in
2) sfa=check
;;
p) pass=check
;;
r) raw=yes
;;
u) user=check
;;
*) usage
@ -123,11 +109,4 @@ shift $((OPTIND - 1))
[ $# -eq 1 ] && [ -n "$1" ] || usage
key=$1
if [ $raw = yes ]; then
if [ $sfa != no ] || [ $pass != no ] || [ $user != no ]; then
err "-r is mutually exclusive with -2pu"
fi
get_raw "$key"
else
get_service "$key" $user $pass $sfa
fi