From a15d0f8ad410a018fd7441fd382782dffff177f9 Mon Sep 17 00:00:00 2001 From: Mark Olesen <Mark.Olesen@Germany> Date: Thu, 18 Dec 2008 20:29:24 +0100 Subject: [PATCH] output banner cosmetics - move url to lower right: makes version information stand out better --- bin/foamUpdateCaseFileHeader | 25 ++++++++++++++----------- src/OpenFOAM/db/IOobject/IOobjectI.H | 4 ++-- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/bin/foamUpdateCaseFileHeader b/bin/foamUpdateCaseFileHeader index f4340fc53c7..311cb21e823 100755 --- a/bin/foamUpdateCaseFileHeader +++ b/bin/foamUpdateCaseFileHeader @@ -45,8 +45,8 @@ options: -h help Updates the header of application files and removes consecutive blank lines. - By default, writes current version in the header. - An alternative version can be specified with -v option. + By default, writes current OpenFOAM version in the header. + An alternative version can be specified with the -v option. USAGE exit 1 @@ -59,8 +59,8 @@ printHeader() { | ========= | | | \\\\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\\\ / O peration | Version: ${foamVersion} | -| \\\\ / A nd | Web: http://www.OpenFOAM.org | -| \\\\/ M anipulation | | +| \\\\ / A nd | | +| \\\\/ M anipulation | www.OpenFOAM.org | \\*---------------------------------------------------------------------------*/ FoamFile { @@ -84,13 +84,13 @@ FoamFileAttribute() { # # OPTIONS # -OPTS=`getopt hv: $*` +opts=$(getopt hv: $*) if [ $? -ne 0 ] then echo "Aborting due to invalid option" usage fi -eval set -- '$OPTS' +eval set -- '$opts' while [ "$1" != "--" ] do case $1 in @@ -110,11 +110,13 @@ shift # constant width for version -foamVersion=`printf %-36s $foamVersion` +foamVersion=$(printf %-36s $foamVersion) # # MAIN # +unset NOTE + for caseFile do if grep FoamFile $caseFile >/dev/null 2>&1 @@ -122,16 +124,17 @@ do echo "Updating case file: $caseFile" sed -n '/FoamFile/,/}/p' $caseFile > FoamFile.tmp - CLASS=`FoamFileAttribute class FoamFile.tmp` - OBJECT=`FoamFileAttribute object FoamFile.tmp` - FORMAT=`FoamFileAttribute format FoamFile.tmp` + FORMAT=$(FoamFileAttribute format FoamFile.tmp) + CLASS=$(FoamFileAttribute class FoamFile.tmp) + OBJECT=$(FoamFileAttribute object FoamFile.tmp) + # extract NOTE? printHeader $FORMAT $CLASS $OBJECT $NOTE > FoamFile.tmp sed '1,/}/d' $caseFile | sed '/./,/^$/!d' >> FoamFile.tmp # use cat to avoid removing/replace soft-links [ -s FoamFile.tmp ] && cat FoamFile.tmp >| $caseFile - rm FoamFile.tmp + rm -f FoamFile.tmp 2>/dev/null else echo " Invalid case file: $caseFile" 1>&2 fi diff --git a/src/OpenFOAM/db/IOobject/IOobjectI.H b/src/OpenFOAM/db/IOobject/IOobjectI.H index 3d8331e0224..20425b8a7db 100644 --- a/src/OpenFOAM/db/IOobject/IOobjectI.H +++ b/src/OpenFOAM/db/IOobject/IOobjectI.H @@ -65,8 +65,8 @@ inline void Foam::IOobject::writeBanner(Stream& os, bool noHint) "| ========= | |\n" "| \\\\ / F ield | OpenFOAM: The Open Source CFD Toolbox |\n" "| \\\\ / O peration | Version: " << FOAMversion << spaces << "|\n" - "| \\\\ / A nd | Web: http://www.OpenFOAM.org |\n" - "| \\\\/ M anipulation | |\n" + "| \\\\ / A nd | |\n" + "| \\\\/ M anipulation | www.OpenFOAM.org |\n" "\\*---------------------------------------------------------------------------*/\n"; } -- GitLab