From 000cbc49b4e191d43714965367d8e99b995d13fe Mon Sep 17 00:00:00 2001
From: Wouter Deconinck <wdconinc@gmail.com>
Date: Fri, 27 Jan 2023 16:23:13 +0000
Subject: [PATCH] fix: lead with REQUIRE_VAR in short circuit evaluation

---
 bin/parse_cmd.sh | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/bin/parse_cmd.sh b/bin/parse_cmd.sh
index 7e8f70f..92fbb1d 100755
--- a/bin/parse_cmd.sh
+++ b/bin/parse_cmd.sh
@@ -104,27 +104,27 @@ elif [ -z $PBEAM ]; then
   echo "ERROR: PBEAM not defined: --pbeam <energy>"
   print_the_help
   exit 1
-elif [ -z $MINQ2 ] && [ ! -z ${REQUIRE_MINQ2:-} ]; then
+elif [ ! -z ${REQUIRE_MINQ2:-} ] && [ -z $MINQ2 ]; then
   echo "ERROR: MINQ2 not defined: --minq2 <energy>"
   print_the_help
   exit 1
-elif [ ! -z $MINQ2 ] && [ -z ${REQUIRE_MINQ2:-} ]; then
+elif [ -z ${REQUIRE_MINQ2:-} ] && [ ! -z $MINQ2 ]; then
   echo "ERROR: MINQ2 flag specified but not required"
   print_the_help
   exit 1
-elif [ -z $LEADING ] && [ ! -z ${REQUIRE_LEADING:-} ]; then
+elif [ ! -z ${REQUIRE_LEADING:-} ] && [ -z $LEADING ]; then
   echo "ERROR: LEADING not defined: --leading <channel>"
   print_the_help
   exit 1
-elif [ ! -z $LEADING ] && [ -z ${REQUIRE_LEADING:-} ]; then
+elif [ -z ${REQUIRE_LEADING:-} ] && [ ! -z $LEADING ]; then
   echo "ERROR: LEADING flag specified but not required"
   print_the_help
   exit 1
-elif [ -z $DECAY ] && [ ! -z ${REQUIRE_DECAY:-} ]; then
+elif [ ! -z ${REQUIRE_DECAY:-} ] && [ -z $DECAY ]; then
   echo "ERROR: DECAY not defined: --decay <channel>"
   print_the_help
   exit 1
-elif [ ! -z $DECAY ] && [ -z ${REQUIRE_DECAY:-} ]; then
+elif [ -z ${REQUIRE_DECAY:-} ] && [ ! -z $DECAY ]; then
   echo "ERROR: DECAY flag specified but not required"
   print_the_help
   exit 1
-- 
GitLab