aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xotp.bash6
1 files changed, 5 insertions, 1 deletions
diff --git a/otp.bash b/otp.bash
index 5c06dc5..72e3aa2 100755
--- a/otp.bash
+++ b/otp.bash
@@ -273,7 +273,11 @@ cmd_otp_append() {
[[ -n "$existing" ]] && yesno "An OTP secret already exists for $path. Overwrite it?"
if [[ $from_secret -eq 1 ]]; then
- ([[ -z "$issuer" ]] || [[ -z "$account" ]]) && die "Missing issuer or account"
+ [ -z "$issuer" ] && issuer=false
+ [ -z "$account" ] && account=false
+
+ [ "$issuer" = false ] && [ "$account" = false ] && die "Missing one of either '--issuer' or '--account'"
+
otp_read_secret "$prompt" $echo "$issuer" "$account"
else
otp_read_uri "$prompt" $echo