consistency update: foamNew, foamNewSource, foamNewTemplate

- simplified the logic
- provide direct link to the respective scripts
- provide help from the respective scripts
This commit is contained in:
Mark Olesen
2009-08-02 12:43:24 +02:00
parent 270f14f644
commit e211ff7dab
21 changed files with 182 additions and 177 deletions

View File

@ -33,7 +33,6 @@
usage() {
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
cat<<USAGE
usage: ${0##*/} <type> {args}
* create a new standard OpenFOAM source or template file
@ -44,22 +43,18 @@ USAGE
exit 1
}
if [ "$#" -lt 2 ]
then
usage "wrong number of arguments, expected 2 (or more)"
fi
# this implicitly covers a lone -help, but let other scripts handle the rest
[ "$#" -gt 1 ] || usage
case "$1" in
-h | -help)
usage
;;
source)
shift
$WM_PROJECT_DIR/bin/foamTemplates/source/newSource $*
$WM_PROJECT_DIR/bin/templates/source/foamNewSource $*
;;
template)
shift
$WM_PROJECT_DIR/bin/foamTemplates/sourceTemplate/newSourceTemplate $*
$WM_PROJECT_DIR/bin/templates/sourceTemplate/foamNewTemplate $*
;;
*)
usage "unknown type"