From d8291f848d5f96fe6f27957f426609078ae6c310 Mon Sep 17 00:00:00 2001 From: Chris Greenshields Date: Mon, 29 May 2017 21:02:16 +0100 Subject: [PATCH] Scripts in bin: added -help to scripts --- bin/foamCleanTutorials | 35 +++++++++++++++++++++++++-------- bin/foamRunTutorials | 44 ++++++++++++++++++++++++++---------------- 2 files changed, 54 insertions(+), 25 deletions(-) diff --git a/bin/foamCleanTutorials b/bin/foamCleanTutorials index 8712bb25f..5777b8ecb 100755 --- a/bin/foamCleanTutorials +++ b/bin/foamCleanTutorials @@ -3,7 +3,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation +# \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation # \\/ M anipulation | #------------------------------------------------------------------------------ # License @@ -30,15 +30,34 @@ # and all its subdirectories. # #------------------------------------------------------------------------------ +Script=$PWD/${0##*/} # Source tutorial clean functions -. $WM_PROJECT_DIR/bin/tools/CleanFunctions +. "$WM_PROJECT_DIR/bin/tools/CleanFunctions" -thisScript=$0 -if [ "/${thisScript#/}" != "$thisScript" ] -then - thisScript="$PWD/$thisScript" -fi +usage() { + cat</dev/null && $thisScript ) + ( cd "$caseName" 2>/dev/null && $Script ) done fi diff --git a/bin/foamRunTutorials b/bin/foamRunTutorials index 7aabb6c48..e58f76c61 100755 --- a/bin/foamRunTutorials +++ b/bin/foamRunTutorials @@ -3,7 +3,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation +# \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation # \\/ M anipulation | #------------------------------------------------------------------------------ # License @@ -30,18 +30,26 @@ # and all its subdirectories. # #------------------------------------------------------------------------------ +Script=$PWD/${0##*/} # Normally use standard "make" make="make" # Source tutorial run functions -. $WM_PROJECT_DIR/bin/tools/RunFunctions +. "$WM_PROJECT_DIR/bin/tools/RunFunctions" -thisScript=$0 -if [ "/${thisScript#/}" != "$thisScript" ] -then - thisScript="$PWD/$thisScript" -fi +usage() { + cat<