mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
STYLE: allow '=' option separators in some bin/tools scripts
This commit is contained in:
committed by
Andrew Heather
parent
ff81ec8cf3
commit
f7a707e00e
@ -1,2 +1,2 @@
|
|||||||
Misc. tools, scripts, templates that are useful (eg, for building applications)
|
Miscellaneous tools, scripts, templates that are useful
|
||||||
but don't need to be in the PATH.
|
(eg, for building applications) but don't need to be in the PATH.
|
||||||
|
|||||||
@ -209,8 +209,7 @@ replaceCsh()
|
|||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
# Get the option's value (argument).
|
# Get the option's value (argument), or die on missing or empty argument
|
||||||
# Die if the argument doesn't exist or is empty
|
|
||||||
# $1 option
|
# $1 option
|
||||||
# $2 value
|
# $2 value
|
||||||
getOptionValue()
|
getOptionValue()
|
||||||
|
|||||||
@ -26,11 +26,11 @@ usage() {
|
|||||||
|
|
||||||
Usage: ${0##*/} [OPTION] [appName .. [appNameN]]
|
Usage: ${0##*/} [OPTION] [appName .. [appNameN]]
|
||||||
options:
|
options:
|
||||||
-dir DIR Directory to process
|
-dir=DIR Input directory to process
|
||||||
-output DIR Write to alternative output directory
|
-output=DIR Write to alternative output directory
|
||||||
-pdf Process as nroff man content and pass to ps2pdf
|
-pdf Process as nroff man content and pass to ps2pdf
|
||||||
-gz | -gzip Compress manpage output
|
-gz | -gzip Compress manpage output
|
||||||
-version VER Specify an alternative version
|
-version=VER Specify an alternative version
|
||||||
-h | -help Print the usage
|
-h | -help Print the usage
|
||||||
|
|
||||||
Query OpenFOAM applications with -help-man for their manpage content
|
Query OpenFOAM applications with -help-man for their manpage content
|
||||||
@ -58,6 +58,15 @@ die()
|
|||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Get the option's value (argument), or die on missing or empty argument
|
||||||
|
# $1 option
|
||||||
|
# $2 value
|
||||||
|
getOptionValue()
|
||||||
|
{
|
||||||
|
[ -n "$2" ] || die "'$1' option requires an argument"
|
||||||
|
echo "$2"
|
||||||
|
}
|
||||||
|
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
searchDirs="$FOAM_APPBIN"
|
searchDirs="$FOAM_APPBIN"
|
||||||
unset sedFilter outputDir outputType
|
unset sedFilter outputDir outputType
|
||||||
@ -68,9 +77,12 @@ do
|
|||||||
-h | -help*)
|
-h | -help*)
|
||||||
usage
|
usage
|
||||||
;;
|
;;
|
||||||
|
-dir=*)
|
||||||
|
searchDirs="${1#*=}"
|
||||||
|
[ -d "$searchDirs" ] || die "directory not found '$searchDirs'"
|
||||||
|
;;
|
||||||
-dir)
|
-dir)
|
||||||
[ "$#" -ge 2 ] || die "'$1' option requires an argument"
|
searchDirs=$(getOptionValue "$@")
|
||||||
searchDirs="$2"
|
|
||||||
[ -d "$searchDirs" ] || die "directory not found '$searchDirs'"
|
[ -d "$searchDirs" ] || die "directory not found '$searchDirs'"
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
@ -80,15 +92,20 @@ do
|
|||||||
-pdf)
|
-pdf)
|
||||||
outputType="pdf"
|
outputType="pdf"
|
||||||
;;
|
;;
|
||||||
|
-version=*)
|
||||||
|
version="${1#*=}"
|
||||||
|
sedFilter='s/OpenFOAM-[^\"]*/OpenFOAM-'"$version/"
|
||||||
|
;;
|
||||||
-version)
|
-version)
|
||||||
[ "$#" -ge 2 ] || die "'$1' option requires an argument"
|
version=$(getOptionValue "$@")
|
||||||
version="$2"
|
|
||||||
sedFilter='s/OpenFOAM-[^\"]*/OpenFOAM-'"$version/"
|
sedFilter='s/OpenFOAM-[^\"]*/OpenFOAM-'"$version/"
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
|
-output=*)
|
||||||
|
outputDir="${1#*=}"
|
||||||
|
;;
|
||||||
-output)
|
-output)
|
||||||
[ "$#" -ge 2 ] || die "'$1' option requires an argument"
|
outputDir=$(getOptionValue "$@")
|
||||||
outputDir="$2"
|
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
-*)
|
-*)
|
||||||
@ -101,7 +118,7 @@ do
|
|||||||
shift
|
shift
|
||||||
done
|
done
|
||||||
|
|
||||||
: ${outputDir:=$defaultOutputDir}
|
: "${outputDir:=$defaultOutputDir}"
|
||||||
|
|
||||||
# Verify that output is writeable
|
# Verify that output is writeable
|
||||||
if [ -e "$outputDir" ]
|
if [ -e "$outputDir" ]
|
||||||
|
|||||||
@ -28,7 +28,7 @@
|
|||||||
# Description
|
# Description
|
||||||
# Simple script generator for packing OpenFOAM sources and submodules
|
# Simple script generator for packing OpenFOAM sources and submodules
|
||||||
#
|
#
|
||||||
# $ foamPackRelease -output some/path origin/master > create-tar
|
# $ foamPackRelease -output=some/path origin/master > create-tar
|
||||||
# $ bash ./create-tar
|
# $ bash ./create-tar
|
||||||
#
|
#
|
||||||
# Or directly:
|
# Or directly:
|
||||||
@ -46,7 +46,7 @@ cat <<USAGE
|
|||||||
|
|
||||||
Usage: ${0##*/} [OPTION] commit-ish
|
Usage: ${0##*/} [OPTION] commit-ish
|
||||||
options:
|
options:
|
||||||
-output DIR Specify alternative output directory
|
-output=dir Write to alternative output directory
|
||||||
-no-modules Exclude submodules
|
-no-modules Exclude submodules
|
||||||
-no-patch Ignore _patch number for the output tar-file
|
-no-patch Ignore _patch number for the output tar-file
|
||||||
-compress=TYPE Compress with specified type
|
-compress=TYPE Compress with specified type
|
||||||
@ -78,6 +78,7 @@ die()
|
|||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
outputDir="."
|
outputDir="."
|
||||||
unset skipModules skipPatchNum
|
unset skipModules skipPatchNum
|
||||||
@ -94,6 +95,9 @@ do
|
|||||||
outputDir="$2"
|
outputDir="$2"
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
|
-output=*)
|
||||||
|
outputDir="${1#*=}"
|
||||||
|
;;
|
||||||
-no-modules)
|
-no-modules)
|
||||||
skipModules=true
|
skipModules=true
|
||||||
;;
|
;;
|
||||||
@ -291,7 +295,7 @@ case "$compress" in
|
|||||||
|
|
||||||
(tgz)
|
(tgz)
|
||||||
echo "Using gzip compression with tgz ending" 1>&2
|
echo "Using gzip compression with tgz ending" 1>&2
|
||||||
echo 'gzip -c9 "$outputDir/$tarName.tar" > "$outputDir/$tarName.tgz"'
|
echo 'gzip -c -9 "$outputDir/$tarName.tar" > "$outputDir/$tarName.tgz"'
|
||||||
;;
|
;;
|
||||||
|
|
||||||
(bz | bzip | bzip2)
|
(bz | bzip | bzip2)
|
||||||
|
|||||||
@ -4,10 +4,10 @@
|
|||||||
# git-find-trailingspace
|
# git-find-trailingspace
|
||||||
#
|
#
|
||||||
# Description
|
# Description
|
||||||
# Use git grep to search for files with trailing whitespace
|
# Use git grep to find files with trailing whitespace
|
||||||
#
|
#
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
git grep -c -P '\s+$' -- $@
|
git grep --count -P '\s+$' -- $@
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|||||||
Reference in New Issue
Block a user