ENH: more succinct output from command-line errors.

- unknown options or missing option values now emit a shorter message
  without the entire usage. This makes it easier to identify the errors
  and is better aligned with the behaviour of GNU system tools.

  ====
     $ simpleFoam -case
     Using: OpenFOAM-plus (see www.OpenFOAM.com)
     Build: plus-01234

     Error: option '-case' requires an argument

     See 'simpleFoam -help' for usage
  ====

- provide for reduced (-help) and full (-help-full) usage information.
  In many cases the reduced usage provided sufficient and easier
  to find the information.

- make -srcDoc an alias for -doc-source

- no warnings about option aliases for future dates.
This commit is contained in:
Mark Olesen
2017-11-24 10:27:11 +01:00
parent 9985b93cfc
commit 5947f9a337
54 changed files with 207 additions and 117 deletions

View File

@ -29,18 +29,17 @@
# remove all core files
#------------------------------------------------------------------------------
# default is pwd
if [ "$#" -eq 0 ]
then
set -- .
elif [ "$1" = "-h" -o "$1" = "-help" ]
then
case "$1" in
-h | -help*)
exec 1>&2
echo "Usage: ${0##*/} [dir1] .. [dirN]"
echo " remove all core files"
exit 1
fi
;;
esac
# Default is pwd
[ "$#" -gt 0 ] || set -- .
for i
do