mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: add -current option to foamPackBin, foamPackMake
- reduces typing
This commit is contained in:
@ -57,8 +57,10 @@ usage() {
|
||||
while [ $# -gt 0 ]; do echo "$1" 1>&2; shift; done
|
||||
cat <<USAGE 1>&2
|
||||
Usage: ${0##*/} [OPTION] <archOptions>
|
||||
${0##*/} [OPTION] -current
|
||||
options:
|
||||
-o <dir> specify alternative output directory
|
||||
-c, -current use current value of \$WM_OPTIONS
|
||||
-o, -output <dir> specify alternative output directory
|
||||
|
||||
* Pack and compress binary version of $codeBase for release
|
||||
|
||||
@ -70,7 +72,8 @@ USAGE
|
||||
}
|
||||
|
||||
|
||||
unset prefix outputDir
|
||||
unset archOptions outputDir
|
||||
|
||||
# parse options
|
||||
while [ "$#" -gt 0 ]
|
||||
do
|
||||
@ -78,6 +81,10 @@ do
|
||||
-h | -help)
|
||||
usage
|
||||
;;
|
||||
-c | -current) # use $WM_OPTIONS - eg, 'linux64GccDPOpt'
|
||||
archOptions="$WM_OPTIONS"
|
||||
shift
|
||||
;;
|
||||
-o | -output)
|
||||
[ "$#" -ge 2 ] || usage "'$1' option requires an argument"
|
||||
outputDir=${2%%/}
|
||||
@ -92,10 +99,14 @@ do
|
||||
esac
|
||||
done
|
||||
|
||||
[ $# -eq 1 ] || usage "Error: specify architecture"
|
||||
if [ -n "$archOptions" ]
|
||||
then
|
||||
[ $# -eq 0 ] || usage "Error: cannot specify both -current and architecture"
|
||||
else
|
||||
archOptions="$1"
|
||||
[ $# -eq 1 ] || usage "Error: specify architecture"
|
||||
fi
|
||||
|
||||
# same as $WM_OPTIONS - eg, 'linux64GccDPOpt'
|
||||
archOptions="$1"
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
timeStamp=$(date +%Y-%m-%d)
|
||||
|
||||
Reference in New Issue
Block a user