From 8790ccde667757245931ca3ab04e557a12d526b3 Mon Sep 17 00:00:00 2001 From: Brandon Rozek Date: Wed, 29 Mar 2023 21:25:00 -0400 Subject: [PATCH] Argument count check --- run_spectra.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/run_spectra.sh b/run_spectra.sh index 4d2de45..a5e6845 100755 --- a/run_spectra.sh +++ b/run_spectra.sh @@ -1,6 +1,18 @@ #!/bin/sh -# TODO: Argument check and show usage +set -o errexit +set -o nounset + +show_usage() { + echo "Usage: ./run_spectra.sh [FILENAME]" + exit 1 +} + +# Check argument count +if [ "$#" -ne 1 ]; then + show_usage +fi + mvn -q exec:java -Dexec.mainClass="com.naveensundarg.planner.utils.Runner" -Dexec.args="$1"