From cae5d5088ef5056ab3d3e4c144ec1b02d4ee2d3d Mon Sep 17 00:00:00 2001 From: xPMo Date: Mon, 21 May 2018 17:11:28 -0500 Subject: Fix behaviour for otp append as well --- otp.bash | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3