Skip to content
Snippets Groups Projects

fix: set LEADING, allow undefined throughout

Merged Wouter Deconinck requested to merge wdconinc-master-patch-68861 into master
1 file
+ 16
13
Compare changes
  • Side-by-side
  • Inline
+ 16
13
@@ -26,13 +26,15 @@ function print_the_help {
@@ -26,13 +26,15 @@ function print_the_help {
echo "REQUIRED ARGUMENTS:"
echo "REQUIRED ARGUMENTS:"
echo " --ebeam Electron beam energy"
echo " --ebeam Electron beam energy"
echo " --pbeam Ion beam energy"
echo " --pbeam Ion beam energy"
echo " --minq2 Minimum momentum transfer"
echo " --config Generator configuration identifiers (at least one)"
echo " --config Generator configuration identifiers (at least one)"
 
if [ ! -z ${REQUIRE_MINQ2:-} ]; then
 
echo " --minq2 Minimum momentum transfer"
 
fi
if [ ! -z ${REQUIRE_DECAY:-} ]; then
if [ ! -z ${REQUIRE_DECAY:-} ]; then
echo " --decay Specific decay particle (e.g. muon)."
echo " --decay Specific decay particle (e.g. muon)."
fi
fi
if [ ! -z ${REQUIRE_LEADING:-} ]; then
if [ ! -z ${REQUIRE_LEADING:-} ]; then
echo " --leading Leading particle of interest (e.g. jpsi)."
echo " --leading Leading particle of interest (e.g. jpsi)."
fi
fi
echo " -h,--help Print this message"
echo " -h,--help Print this message"
echo ""
echo ""
@@ -44,8 +46,9 @@ function print_the_help {
@@ -44,8 +46,9 @@ function print_the_help {
EBEAM=
EBEAM=
PBEAM=
PBEAM=
MINQ2=
MINQ2=
DECAYS=
DECAY=
CONFIG=
CONFIG=
 
LEADING=
while [ $# -gt 0 ]
while [ $# -gt 0 ]
do
do
@@ -92,39 +95,39 @@ do
@@ -92,39 +95,39 @@ do
esac
esac
done
done
if [ -z $CONFIG ]; then
if [ -z ${CONFIG:-} ]; then
echo "ERROR: CONFIG not defined: --config <config>"
echo "ERROR: CONFIG not defined: --config <config>"
print_the_help
print_the_help
exit 1
exit 1
elif [ -z $EBEAM ]; then
elif [ -z ${EBEAM:-} ]; then
echo "ERROR: EBEAM not defined: --ebeam <energy>"
echo "ERROR: EBEAM not defined: --ebeam <energy>"
print_the_help
print_the_help
exit 1
exit 1
elif [ -z $PBEAM ]; then
elif [ -z ${PBEAM:-} ]; then
echo "ERROR: PBEAM not defined: --pbeam <energy>"
echo "ERROR: PBEAM not defined: --pbeam <energy>"
print_the_help
print_the_help
exit 1
exit 1
elif [ ! -z ${REQUIRE_MINQ2:-} ] && [ -z $MINQ2 ]; then
elif [ ! -z ${REQUIRE_MINQ2:-} ] && [ -z ${MINQ2:-} ]; then
echo "ERROR: MINQ2 not defined: --minq2 <energy>"
echo "ERROR: MINQ2 not defined: --minq2 <energy>"
print_the_help
print_the_help
exit 1
exit 1
elif [ -z ${REQUIRE_MINQ2:-} ] && [ ! -z $MINQ2 ]; then
elif [ -z ${REQUIRE_MINQ2:-} ] && [ ! -z ${MINQ2:-} ]; then
echo "ERROR: MINQ2 flag specified but not required"
echo "ERROR: MINQ2 flag specified but not required"
print_the_help
print_the_help
exit 1
exit 1
elif [ ! -z ${REQUIRE_LEADING:-} ] && [ -z $LEADING ]; then
elif [ ! -z ${REQUIRE_LEADING:-} ] && [ -z ${LEADING:-} ]; then
echo "ERROR: LEADING not defined: --leading <channel>"
echo "ERROR: LEADING not defined: --leading <channel>"
print_the_help
print_the_help
exit 1
exit 1
elif [ -z ${REQUIRE_LEADING:-} ] && [ ! -z $LEADING ]; then
elif [ -z ${REQUIRE_LEADING:-} ] && [ ! -z ${LEADING:-} ]; then
echo "ERROR: LEADING flag specified but not required"
echo "ERROR: LEADING flag specified but not required"
print_the_help
print_the_help
exit 1
exit 1
elif [ ! -z ${REQUIRE_DECAY:-} ] && [ -z $DECAY ]; then
elif [ ! -z ${REQUIRE_DECAY:-} ] && [ -z ${DECAY:-} ]; then
echo "ERROR: DECAY not defined: --decay <channel>"
echo "ERROR: DECAY not defined: --decay <channel>"
print_the_help
print_the_help
exit 1
exit 1
elif [ -z ${REQUIRE_DECAY:-} ] && [ ! -z $DECAY ]; then
elif [ -z ${REQUIRE_DECAY:-} ] && [ ! -z ${DECAY:-} ]; then
echo "ERROR: DECAY flag specified but not required"
echo "ERROR: DECAY flag specified but not required"
print_the_help
print_the_help
exit 1
exit 1
Loading