Skip to content

Commit 5ba7a1d

Browse files
committed
add usage info
1 parent 2883b97 commit 5ba7a1d

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

run-clara

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,11 @@ set -e
66
inputdir=.
77
outputdir=.
88
threads=2
9-
usage="asdf"
10-
info="qwer"
9+
usage="Usage: run-clara -y yamlfile [-i dir] [-o dir] [-t threads] [-n nevents] [CLARA_HOME]"
1110

1211
while [[ $# -gt 0 ]]; do
1312
case $1 in
14-
-h) echo -e "\n$usage" && echo -e "\n$info" && exit 1 ;;
13+
-h) echo -e "$usage" && exit 0 ;;
1514
-i) inputdir="$2" && shift && shift ;;
1615
-o) outputdir="$2" && shift && shift ;;
1716
-t) threads="$2" && shift && shift ;;
@@ -27,10 +26,13 @@ function error() {
2726
exit 1
2827
}
2928

30-
[ "${#args[@]}" -lt 1 ] && error "Missing PATH argument"
31-
[ "${#args[@]}" -gt 1 ] && error "Extra PATH arguments: ${args[@]:1}"
32-
export CLARA_HOME="$args"
33-
[ ! -e "$CLARA_HOME" ] && error "Missing installation PATH: $CLARA_HOME"
29+
if [ "${#args[@]}" -lt 1 ]; then
30+
[ -z ${CLARA_HOME+x} ] && error "CLARA_HOME undefined."
31+
else
32+
[ "${#args[@]}" -gt 1 ] && error "Extra arguments: ${args[@]:1}"
33+
export CLARA_HOME="$args"
34+
fi
35+
[ ! -e "$CLARA_HOME" ] && error "Missing CLARA_HOME: $CLARA_HOME"
3436
[ -z ${yaml+x} ] && error "-y YAML must be specified."
3537
[ -r $yaml ] || error "YAML file does not exist."
3638
[ -d $inputdir ] || error "Input dir does not exist."

0 commit comments

Comments
 (0)