From 4ceb6ff073b93643635e2a55092b5d7db825eeec Mon Sep 17 00:00:00 2001 From: emma Date: Sun, 24 Dec 2023 03:14:08 -0700 Subject: [PATCH] moved dep check to before argv1 check --- protonkey | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/protonkey b/protonkey index 401253b..898af09 100755 --- a/protonkey +++ b/protonkey @@ -19,16 +19,16 @@ argv0="$0" -if test -z "$1"; then - printf "Usage: %s [ProtonMail address...]\n" "$argv0" 1>&2 - exit 64 # syexits(3) EX_USAGE -fi - if ! command -v curl > /dev/null; then printf "%s: Missing dependency: curl(1)\n" "$0" 1>&2 exit 69 # sysexits(3) EX_UNAVAILABLE fi +if test -z "$1"; then + printf "Usage: %s [ProtonMail address...]\n" "$argv0" 1>&2 + exit 64 # syexits(3) EX_USAGE +fi + while test -n "$1"; do URL="https://api.protonmail.ch/pks/lookup?op=get&search=$1" RESPONSE="$(curl -s "$URL")"