File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed
Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change 66inputdir=.
77outputdir=.
88threads=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
1211while [[ $# -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."
You can’t perform that action at this time.
0 commit comments