$> ./candi.sh --prefix=Your/Prefix/Path
```
-#### CLO: Multiple build processes: `[-j<N>]`, `[--PROCS=<N>]`
+#### CLO: Multiple build processes: `[-j <N>]`, `[-j<N>]`, `[--PROCS=<N>]`
```bash
- $> ./candi.sh -j<N>
+ $> ./candi.sh -j <N>
```
-* Remark: there is no whitespace character allowed between `-j` and the number `<N>`.
-* Example: using 2 build processes type `./candi.sh -j2` or `./candi.sh --PROCS=2`.
-* Be careful with that! You need to have enough system memory (e.g. at least 8GB for using 2 or more processes).
+* Example: to use 2 build processes type `./candi.sh -j2`.
+* Be careful with this option! You need to have enough system memory (e.g. at least 8GB for 2 or more processes).
### Configuration file options (CFO)
################################################################################
# Parse command line input parameters
+PREFIX=~/apps/candi
+PROCS=1
+
while [ -n "$1" ]; do
param="$1"
case $param in
+
+ -h|--help)
+ echo "candi (Compile & Install)"
+ echo ""
+ echo "Usage: $0 [options]"
+ echo "Options:"
+ echo " -p <path>, --prefix=<path> set a different prefix path (default $PREFIX)"
+ echo " -j <N>, -j<N>, --PROCS=<N> compile with N processes in parallel (default $PROCS)"
+ echo " --platform=<platform> force usage of a particular platform file"
+ echo ""
+ echo "The configuration including the choice of packages to install is stored in candi.cfg, see README.md for more information."
+ exit 0
+ ;;
+
#####################################
# Prefix path
-p=*|--prefix=*)
#####################################
# Number of maximum processes to use
--PROCS=*)
- NP="${param#*=}"
+ PROCS="${param#*=}"
;;
# Make styled processes with or without space
-j)
shift
- NP="${1}"
+ PROCS="${1}"
;;
-j*)
- NP="${param#*j}"
+ PROCS="${param#*j}"
;;
#####################################
done
PREFIX_PATH=${PREFIX:-~/apps/candi}
-PROCS=${NP:-1}
+
+RE='^[0-9]+$'
+if [[ ! "$PROCS" =~ $RE || $PROCS<1 ]] ; then
+ echo "ERROR: invalid number of build processes '$PROCS'"
+ exit 1
+fi
################################################################################
# Set download tool