ENH: add -current option to foamPackBin, foamPackMake

- reduces typing
This commit is contained in:
Mark Olesen
2011-02-15 10:08:46 +01:00
parent cf65eebcd5
commit 449a0e253d
6 changed files with 48 additions and 26 deletions

View File

@ -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)