From 2893864401bca364e5ebe205571c2bd227184dea Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Tue, 23 Jan 2018 22:51:45 -0500 Subject: [PATCH] Simplify bin/pass-otpuri --- bin/pass-otpuri | 30 +++++------------------------- 1 file changed, 5 insertions(+), 25 deletions(-) diff --git a/bin/pass-otpuri b/bin/pass-otpuri index 12e418b2..9b6017f2 100755 --- a/bin/pass-otpuri +++ b/bin/pass-otpuri @@ -1,31 +1,11 @@ #!/usr/bin/env bash -# Generates an OTP-auth url (written for pass-otp) +# Interactively generates an OTP-auth url (written for pass-otp) # # Example: passotpuri LABEL SECRET [QUERYSTRING] -type=totp -issuer= -while getopts tih opt; do - case $opt in - t) type="$OPTARG" ;; - i) issuer="$OPTARG" ;; - h) cat <&2 echo "Aborted." - exit 1 ;; - esac -done -shift $((OPTIND-1)) - -label="$1" -secret="$2" -args="${3:+&$3}" - -echo "otpauth://$type/$label?secret=$secret&issuer=${issuer:-$label}$args" +echo "otpauth://${type:-totp}/$label?secret=$secret&issuer=${issuer:-$label}"