mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
STYLE: limit foamCreateManpage to documented options
Previously silently accepted '-o' as being equivalent to '-output', but the former could be misinterpreted meaning an output file (which it is not) instead of an output directory.
This commit is contained in:
@ -3,7 +3,7 @@
|
|||||||
# ========= |
|
# ========= |
|
||||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
# \\ / O peration |
|
# \\ / O peration |
|
||||||
# \\ / A nd | Copyright (C) 2018 OpenCFD Ltd.
|
# \\ / A nd | Copyright (C) 2018-2019 OpenCFD Ltd.
|
||||||
# \\/ M anipulation |
|
# \\/ M anipulation |
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# License
|
# License
|
||||||
@ -26,10 +26,10 @@ usage() {
|
|||||||
|
|
||||||
Usage: ${0##*/} [OPTION] [appName .. [appNameN]]
|
Usage: ${0##*/} [OPTION] [appName .. [appNameN]]
|
||||||
options:
|
options:
|
||||||
-dir dir Directory to process
|
-dir DIR Directory to process
|
||||||
-gzip Compressed manpage output
|
|
||||||
-pdf Process as manpage and pass to ps2pdf
|
|
||||||
-output DIR Write to alternative output directory
|
-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
|
-h | -help Print the usage
|
||||||
|
|
||||||
@ -38,9 +38,9 @@ and redirect to corresponding directory location.
|
|||||||
Default input: \$FOAM_APPBIN only.
|
Default input: \$FOAM_APPBIN only.
|
||||||
Default output: $defaultOutputDir
|
Default output: $defaultOutputDir
|
||||||
|
|
||||||
Uses the search directory if applications are specified.
|
Uses the search directory if individual applications are specified.
|
||||||
|
|
||||||
Copyright (C) 2018 OpenCFD Ltd.
|
Copyright (C) 2018-2019 OpenCFD Ltd.
|
||||||
USAGE
|
USAGE
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
@ -80,13 +80,13 @@ do
|
|||||||
-pdf)
|
-pdf)
|
||||||
outputType="pdf"
|
outputType="pdf"
|
||||||
;;
|
;;
|
||||||
-v | -version)
|
-version)
|
||||||
[ "$#" -ge 2 ] || die "'$1' option requires an argument"
|
[ "$#" -ge 2 ] || die "'$1' option requires an argument"
|
||||||
version="$2"
|
version="$2"
|
||||||
sedFilter='s/OpenFOAM-[^\"]*/OpenFOAM-'"$version/"
|
sedFilter='s/OpenFOAM-[^\"]*/OpenFOAM-'"$version/"
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
-o | -output)
|
-output)
|
||||||
[ "$#" -ge 2 ] || die "'$1' option requires an argument"
|
[ "$#" -ge 2 ] || die "'$1' option requires an argument"
|
||||||
outputDir="$2"
|
outputDir="$2"
|
||||||
shift
|
shift
|
||||||
@ -104,7 +104,7 @@ done
|
|||||||
: ${outputDir:=$defaultOutputDir}
|
: ${outputDir:=$defaultOutputDir}
|
||||||
|
|
||||||
# Verify that output is writeable
|
# Verify that output is writeable
|
||||||
if [ -e x"$outputDir" ]
|
if [ -e "$outputDir" ]
|
||||||
then
|
then
|
||||||
[ -d "$outputDir" ] && [ -w "$outputDir" ] || \
|
[ -d "$outputDir" ] && [ -w "$outputDir" ] || \
|
||||||
die "Cannot write to $outputDir" "Not a directory, or no permission?"
|
die "Cannot write to $outputDir" "Not a directory, or no permission?"
|
||||||
|
|||||||
Reference in New Issue
Block a user