From f691fe7896aff38a6160f3a885fe005d357fd329 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Tue, 15 Feb 2011 16:48:26 +0100 Subject: [PATCH] STYLE: more consistent use of stderr for script usage --- bin/engridFoam | 3 ++- bin/foamClearPolyMesh | 7 ++++--- bin/foamCopySettings | 7 ++++--- bin/foamEndJob | 3 ++- bin/foamExec | 1 + bin/foamJob | 3 ++- bin/foamLog | 3 ++- bin/foamNew | 3 ++- bin/foamNewCase | 3 ++- bin/foamPack | 5 +++-- bin/foamPackBin | 5 +++-- bin/foamPackDeps | 5 +++-- bin/foamPackDoxygen | 5 +++-- bin/foamPackMake | 5 +++-- bin/foamPackThirdParty | 5 +++-- bin/foamUpdateCaseFileHeader | 3 ++- bin/paraFoam | 3 ++- bin/rmdepall | 5 +++-- bin/rmdepold | 5 +++-- bin/tools/foamConfigurePaths | 3 ++- bin/tools/org-batch | 5 +++-- bin/touchdep | 1 + bin/toucho | 1 + 23 files changed, 56 insertions(+), 33 deletions(-) diff --git a/bin/engridFoam b/bin/engridFoam index 076f34ddee..6384c365e2 100755 --- a/bin/engridFoam +++ b/bin/engridFoam @@ -3,7 +3,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. +# \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd. # \\/ M anipulation | #------------------------------------------------------------------------------- # License @@ -30,6 +30,7 @@ # #------------------------------------------------------------------------------ usage() { + exec 1>&2 while [ "$#" -ge 1 ]; do echo "$1"; shift; done cat<&2; shift; done - cat <&2 + exec 1>&2 + while [ "$#" -ge 1 ]; do echo "$1"; shift; done + cat <&2; shift; done - cat <&2 + exec 1>&2 + while [ "$#" -ge 1 ]; do echo "$1"; shift; done + cat <&2 while [ "$#" -ge 1 ]; do echo "$1"; shift; done cat< diff --git a/bin/foamExec b/bin/foamExec index 47a2428ccd..26ad311349 100755 --- a/bin/foamExec +++ b/bin/foamExec @@ -39,6 +39,7 @@ # foamEtcFile #------------------------------------------------------------------------------ usage() { + exec 1>&2 while [ "$#" -ge 1 ]; do echo "$1"; shift; done cat<&2 while [ "$#" -ge 1 ]; do echo "$1"; shift; done cat<&2 while [ "$#" -ge 1 ]; do echo "$1"; shift; done cat <&2 while [ "$#" -ge 1 ]; do echo "$1"; shift; done cat< {args} diff --git a/bin/foamNewCase b/bin/foamNewCase index 52cd516bb6..fda86b4bdd 100755 --- a/bin/foamNewCase +++ b/bin/foamNewCase @@ -3,7 +3,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd. +# \\ / A nd | Copyright (C) 2010-2011 OpenCFD Ltd. # \\/ M anipulation | #------------------------------------------------------------------------------- # License @@ -37,6 +37,7 @@ templateDir="appTemplates" #------------------------------------------------------------------------------ usage() { + exec 1>&2 while [ "$#" -ge 1 ]; do echo "$1"; shift; done cat<&2; shift; done -cat <&2 + exec 1>&2 + while [ "$#" -gt 0 ]; do echo "$1"; shift; done +cat < specify alternative output directory diff --git a/bin/foamPackBin b/bin/foamPackBin index 1aee24cadf..36614ab781 100755 --- a/bin/foamPackBin +++ b/bin/foamPackBin @@ -54,8 +54,9 @@ esac usage() { - while [ $# -gt 0 ]; do echo "$1" 1>&2; shift; done -cat <&2 + exec 1>&2 + while [ "$#" -gt 0 ]; do echo "$1"; shift; done +cat < ${0##*/} [OPTION] -current options: diff --git a/bin/foamPackDeps b/bin/foamPackDeps index d0c6552122..ab663a04c4 100755 --- a/bin/foamPackDeps +++ b/bin/foamPackDeps @@ -52,8 +52,9 @@ esac usage() { - while [ $# -gt 0 ]; do echo "$1" 1>&2; shift; done -cat <&2 + exec 1>&2 + while [ "$#" -gt 0 ]; do echo "$1"; shift; done +cat <&2; shift; done -cat <&2 + exec 1>&2 + while [ "$#" -gt 0 ]; do echo "$1"; shift; done +cat <&2; shift; done -cat <&2 + exec 1>&2 + while [ "$#" -gt 0 ]; do echo "$1"; shift; done +cat < ${0##*/} [OPTION] -current options: diff --git a/bin/foamPackThirdParty b/bin/foamPackThirdParty index 37625b42cd..bb7c0f6d78 100755 --- a/bin/foamPackThirdParty +++ b/bin/foamPackThirdParty @@ -33,8 +33,9 @@ packDir=ThirdParty-$WM_PROJECT_VERSION toolsDir="${0%/*}/tools" # this script is located in the tools/ parent dir usage() { - while [ $# -gt 0 ]; do echo "$1" 1>&2; shift; done -cat <&2 + exec 1>&2 + while [ "$#" -gt 0 ]; do echo "$1"; shift; done +cat < specify alternative output directory diff --git a/bin/foamUpdateCaseFileHeader b/bin/foamUpdateCaseFileHeader index 92d856f749..afc32cf151 100755 --- a/bin/foamUpdateCaseFileHeader +++ b/bin/foamUpdateCaseFileHeader @@ -3,7 +3,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. +# \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd. # \\/ M anipulation | #------------------------------------------------------------------------------ # License @@ -33,6 +33,7 @@ # #------------------------------------------------------------------------------ usage() { + exec 1>&2 while [ "$#" -ge 1 ]; do echo "$1"; shift; done cat<&2 while [ "$#" -ge 1 ]; do echo "$1"; shift; done cat< #------------------------------------------------------------------------------ usage() { + exec 1>&2 while [ "$#" -ge 1 ]; do echo "$1"; shift; done - cat<&2 + cat< diff --git a/bin/rmdepold b/bin/rmdepold index 01197eb04f..bb83bbd9b6 100755 --- a/bin/rmdepold +++ b/bin/rmdepold @@ -3,7 +3,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. +# \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd. # \\/ M anipulation | #------------------------------------------------------------------------------- # License @@ -34,8 +34,9 @@ # - optionally remove empty directories #------------------------------------------------------------------------------ usage() { + exec 1>&2 while [ "$#" -ge 1 ]; do echo "$1"; shift; done - cat<&2 + cat<&2 while [ "$#" -ge 1 ]; do echo "$1"; shift; done cat<&2 while [ "$#" -ge 1 ]; do echo "$1"; shift; done cat<&2 while [ "$#" -ge 1 ]; do echo "$1"; shift; done cat<&2 while [ "$#" -ge 1 ]; do echo "$1"; shift; done cat<