output banner cosmetics

- move url to lower right: makes version information stand out better
This commit is contained in:
Mark Olesen
2008-12-18 20:29:24 +01:00
parent b5f06a3833
commit a15d0f8ad4
2 changed files with 16 additions and 13 deletions

View File

@ -45,8 +45,8 @@ options:
-h help -h help
Updates the header of application files and removes consecutive blank lines. Updates the header of application files and removes consecutive blank lines.
By default, writes current version in the header. By default, writes current OpenFOAM version in the header.
An alternative version can be specified with -v option. An alternative version can be specified with the -v option.
USAGE USAGE
exit 1 exit 1
@ -59,8 +59,8 @@ printHeader() {
| ========= | | | ========= | |
| \\\\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\\\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\\\ / O peration | Version: ${foamVersion} | | \\\\ / O peration | Version: ${foamVersion} |
| \\\\ / A nd | Web: http://www.OpenFOAM.org | | \\\\ / A nd | |
| \\\\/ M anipulation | | | \\\\/ M anipulation | www.OpenFOAM.org |
\\*---------------------------------------------------------------------------*/ \\*---------------------------------------------------------------------------*/
FoamFile FoamFile
{ {
@ -84,13 +84,13 @@ FoamFileAttribute() {
# #
# OPTIONS # OPTIONS
# #
OPTS=`getopt hv: $*` opts=$(getopt hv: $*)
if [ $? -ne 0 ] if [ $? -ne 0 ]
then then
echo "Aborting due to invalid option" echo "Aborting due to invalid option"
usage usage
fi fi
eval set -- '$OPTS' eval set -- '$opts'
while [ "$1" != "--" ] while [ "$1" != "--" ]
do do
case $1 in case $1 in
@ -110,11 +110,13 @@ shift
# constant width for version # constant width for version
foamVersion=`printf %-36s $foamVersion` foamVersion=$(printf %-36s $foamVersion)
# #
# MAIN # MAIN
# #
unset NOTE
for caseFile for caseFile
do do
if grep FoamFile $caseFile >/dev/null 2>&1 if grep FoamFile $caseFile >/dev/null 2>&1
@ -122,16 +124,17 @@ do
echo "Updating case file: $caseFile" echo "Updating case file: $caseFile"
sed -n '/FoamFile/,/}/p' $caseFile > FoamFile.tmp sed -n '/FoamFile/,/}/p' $caseFile > FoamFile.tmp
CLASS=`FoamFileAttribute class FoamFile.tmp` FORMAT=$(FoamFileAttribute format FoamFile.tmp)
OBJECT=`FoamFileAttribute object FoamFile.tmp` CLASS=$(FoamFileAttribute class FoamFile.tmp)
FORMAT=`FoamFileAttribute format FoamFile.tmp` OBJECT=$(FoamFileAttribute object FoamFile.tmp)
# extract NOTE?
printHeader $FORMAT $CLASS $OBJECT $NOTE > FoamFile.tmp printHeader $FORMAT $CLASS $OBJECT $NOTE > FoamFile.tmp
sed '1,/}/d' $caseFile | sed '/./,/^$/!d' >> FoamFile.tmp sed '1,/}/d' $caseFile | sed '/./,/^$/!d' >> FoamFile.tmp
# use cat to avoid removing/replace soft-links # use cat to avoid removing/replace soft-links
[ -s FoamFile.tmp ] && cat FoamFile.tmp >| $caseFile [ -s FoamFile.tmp ] && cat FoamFile.tmp >| $caseFile
rm FoamFile.tmp rm -f FoamFile.tmp 2>/dev/null
else else
echo " Invalid case file: $caseFile" 1>&2 echo " Invalid case file: $caseFile" 1>&2
fi fi

View File

@ -65,8 +65,8 @@ inline void Foam::IOobject::writeBanner(Stream& os, bool noHint)
"| ========= | |\n" "| ========= | |\n"
"| \\\\ / F ield | OpenFOAM: The Open Source CFD Toolbox |\n" "| \\\\ / F ield | OpenFOAM: The Open Source CFD Toolbox |\n"
"| \\\\ / O peration | Version: " << FOAMversion << spaces << "|\n" "| \\\\ / O peration | Version: " << FOAMversion << spaces << "|\n"
"| \\\\ / A nd | Web: http://www.OpenFOAM.org |\n" "| \\\\ / A nd | |\n"
"| \\\\/ M anipulation | |\n" "| \\\\/ M anipulation | www.OpenFOAM.org |\n"
"\\*---------------------------------------------------------------------------*/\n"; "\\*---------------------------------------------------------------------------*/\n";
} }