From a39ed606251e69e66c880034fb206c6657673135 Mon Sep 17 00:00:00 2001 From: Mark Olesen <Mark.Olesen@esi-group.com> Date: Sat, 26 Jan 2019 11:24:52 +0100 Subject: [PATCH] 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. --- bin/tools/foamCreateManpage | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/bin/tools/foamCreateManpage b/bin/tools/foamCreateManpage index d3e0f8154f8..9888413e366 100755 --- a/bin/tools/foamCreateManpage +++ b/bin/tools/foamCreateManpage @@ -3,7 +3,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 2018 OpenCFD Ltd. +# \\ / A nd | Copyright (C) 2018-2019 OpenCFD Ltd. # \\/ M anipulation | #------------------------------------------------------------------------------ # License @@ -26,10 +26,10 @@ usage() { Usage: ${0##*/} [OPTION] [appName .. [appNameN]] options: - -dir dir Directory to process - -gzip Compressed manpage output - -pdf Process as manpage and pass to ps2pdf + -dir DIR Directory 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 -h | -help Print the usage @@ -38,9 +38,9 @@ and redirect to corresponding directory location. Default input: \$FOAM_APPBIN only. 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 exit 1 } @@ -80,13 +80,13 @@ do -pdf) outputType="pdf" ;; - -v | -version) + -version) [ "$#" -ge 2 ] || die "'$1' option requires an argument" version="$2" sedFilter='s/OpenFOAM-[^\"]*/OpenFOAM-'"$version/" shift ;; - -o | -output) + -output) [ "$#" -ge 2 ] || die "'$1' option requires an argument" outputDir="$2" shift @@ -104,7 +104,7 @@ done : ${outputDir:=$defaultOutputDir} # Verify that output is writeable -if [ -e x"$outputDir" ] +if [ -e "$outputDir" ] then [ -d "$outputDir" ] && [ -w "$outputDir" ] || \ die "Cannot write to $outputDir" "Not a directory, or no permission?" -- GitLab