Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Development
openfoam
Commits
f7a707e0
Commit
f7a707e0
authored
Jun 26, 2019
by
Mark OLESEN
Committed by
Andrew Heather
Jun 26, 2019
Browse files
STYLE: allow '=' option separators in some bin/tools scripts
parent
ff81ec8c
Changes
5
Hide whitespace changes
Inline
Side-by-side
bin/tools/README
View file @
f7a707e0
Misc
.
tools, scripts, templates that are useful
(eg, for building applications)
but don't need to be in the PATH.
Misc
ellaneous
tools, scripts, templates that are useful
(eg, for building applications)
but don't need to be in the PATH.
bin/tools/foamConfigurePaths
View file @
f7a707e0
...
...
@@ -209,8 +209,7 @@ replaceCsh()
done
}
# Get the option's value (argument).
# Die if the argument doesn't exist or is empty
# Get the option's value (argument), or die on missing or empty argument
# $1 option
# $2 value
getOptionValue
()
...
...
bin/tools/foamCreateManpage
View file @
f7a707e0
...
...
@@ -26,11 +26,11 @@ usage() {
Usage:
${
0
##*/
}
[OPTION] [appName .. [appNameN]]
options:
-dir
DIR
D
irectory to process
-output
DIR Write to alternative output directory
-dir
=
DIR
Input d
irectory to process
-output
=
DIR Write to alternative output directory
-pdf Process as nroff man content and pass to ps2pdf
-gz | -gzip Compress manpage output
-version
VER Specify an alternative version
-version
=
VER Specify an alternative version
-h | -help Print the usage
Query OpenFOAM applications with -help-man for their manpage content
...
...
@@ -58,6 +58,15 @@ die()
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
"
unset
sedFilter outputDir outputType
...
...
@@ -68,9 +77,12 @@ do
-h
|
-help
*
)
usage
;;
-dir
=
*
)
searchDirs
=
"
${
1
#*=
}
"
[
-d
"
$searchDirs
"
]
||
die
"directory not found '
$searchDirs
'"
;;
-dir
)
[
"$#"
-ge
2
]
||
die
"'
$1
' option requires an argument"
searchDirs
=
"
$2
"
searchDirs
=
$(
getOptionValue
"
$@
"
)
[
-d
"
$searchDirs
"
]
||
die
"directory not found '
$searchDirs
'"
shift
;;
...
...
@@ -80,15 +92,20 @@ do
-pdf
)
outputType
=
"pdf"
;;
-version
=
*
)
version
=
"
${
1
#*=
}
"
sedFilter
=
's/OpenFOAM-[^\"]*/OpenFOAM-'
"
$version
/"
;;
-version
)
[
"$#"
-ge
2
]
||
die
"'
$1
' option requires an argument"
version
=
"
$2
"
version
=
$(
getOptionValue
"
$@
"
)
sedFilter
=
's/OpenFOAM-[^\"]*/OpenFOAM-'
"
$version
/"
shift
;;
-output
=
*
)
outputDir
=
"
${
1
#*=
}
"
;;
-output
)
[
"$#"
-ge
2
]
||
die
"'
$1
' option requires an argument"
outputDir
=
"
$2
"
outputDir
=
$(
getOptionValue
"
$@
"
)
shift
;;
-
*
)
...
...
@@ -101,7 +118,7 @@ do
shift
done
:
${
outputDir
:
=
$defaultOutputDir
}
:
"
${
outputDir
:
=
$defaultOutputDir
}
"
# Verify that output is writeable
if
[
-e
"
$outputDir
"
]
...
...
bin/tools/foamPackRelease
View file @
f7a707e0
...
...
@@ -28,7 +28,7 @@
# Description
# 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
#
# Or directly:
...
...
@@ -46,7 +46,7 @@ cat <<USAGE
Usage:
${
0
##*/
}
[OPTION] commit-ish
options:
-output
DIR Specify
alternative output directory
-output
=dir Write to
alternative output directory
-no-modules Exclude submodules
-no-patch Ignore _patch number for the output tar-file
-compress=TYPE Compress with specified type
...
...
@@ -78,6 +78,7 @@ die()
exit
1
}
#-------------------------------------------------------------------------------
outputDir
=
"."
unset
skipModules skipPatchNum
...
...
@@ -94,6 +95,9 @@ do
outputDir
=
"
$2
"
shift
;;
-output
=
*
)
outputDir
=
"
${
1
#*=
}
"
;;
-no-modules
)
skipModules
=
true
;;
...
...
@@ -291,7 +295,7 @@ case "$compress" in
(
tgz
)
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
)
...
...
bin/tools/git-find-trailingspace
View file @
f7a707e0
...
...
@@ -4,10 +4,10 @@
# git-find-trailingspace
#
# 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+$'
--
$@
#------------------------------------------------------------------------------
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment