Skip to content
Snippets Groups Projects
Commit debb4b42 authored by Mark Olesen's avatar Mark Olesen
Browse files

ENH: add foamEtcFile -silent option to suppress stderr

- need to trap possibly weird input within etc/bashrc, etc/cshrc and
  can't easily redirect stderr in csh.
parent 0fc6700a
No related branches found
No related tags found
No related merge requests found
......@@ -40,7 +40,7 @@
#
#-------------------------------------------------------------------------------
usage() {
[ "$quietOpt" = true ] && exit 1
[ "${quietOpt:-$silentOpt}" = true ] && exit 1
exec 1>&2
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
......@@ -53,6 +53,7 @@ options:
-mode <mode> any combination of u(user), g(group), o(other)
-prefix <dir> specify an alternative installation prefix
-quiet suppress all normal output
-silent suppress all stderr output
-version <ver> specify an alternative OpenFOAM version
in the form Maj.Min.Rev (eg, 1.7.0)
-help print the usage
......@@ -128,7 +129,7 @@ esac
# default mode is 'ugo'
mode=ugo
unset listOpt quietOpt
unset listOpt quietOpt silentOpt
# parse options
while [ "$#" -gt 0 ]
......@@ -162,6 +163,9 @@ do
-q | -quiet)
quietOpt=true
;;
-s | -silent)
silentOpt=true
;;
-v | -version)
[ "$#" -ge 2 ] || usage "'$1' option requires an argument"
version="$2"
......@@ -241,7 +245,7 @@ then
# list directories, or potential file locations
[ "$nArgs" -le 1 ] || usage
# a silly combination, but -quiet has precedence
# a silly combination, but -quiet does have precedence
[ "$quietOpt" = true ] && exit 0
for dir
......
......@@ -160,7 +160,7 @@ _foamEval()
then
_foamSource "$1"
else
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile "$1"`
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile -silent "$1"`
fi
;;
esac
......
......@@ -157,7 +157,7 @@ while ( $#argv > 0 )
if ( -f "$1" ) then
_foamSource "$1"
else
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile "$1"`
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile -silent "$1"`
endif
breaksw
endsw
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment