summaryrefslogtreecommitdiff
path: root/validate
diff options
context:
space:
mode:
authorHerbert Valerio Riedel <hvr@gnu.org>2013-08-31 16:42:06 +0200
committerHerbert Valerio Riedel <hvr@gnu.org>2013-08-31 16:42:06 +0200
commitea87014a7ad4454f18bb15f6f0ee4b6e61b148be (patch)
tree0d104469e1f74bd1b0101f51e12d0f968a18eb04 /validate
parente446551209c2466871e586956ef33a53c9e3b0d2 (diff)
downloadhaskell-ea87014a7ad4454f18bb15f6f0ee4b6e61b148be.tar.gz
Teach `validate` script how to `--help`
This basically turns the comment at the beginning of the `validate` shell script into an interactive `--help` output plus some minor additions.
Diffstat (limited to 'validate')
-rwxr-xr-xvalidate50
1 files changed, 35 insertions, 15 deletions
diff --git a/validate b/validate
index 170bb2db25..95425d3770 100755
--- a/validate
+++ b/validate
@@ -1,21 +1,37 @@
#!/bin/sh
-# Flags:
-# --no-clean: don't make clean first, just carry on from
-# a previous interrupted validation run
-# --testsuite-only: don't build the compiler, just run
-# the test suite
-# --hpc: build stage2 with -fhpc, and see how much of the
-# compiler the test suite covers.
-# 2008-07-01: 63% slower than the default.
-# HTML generated here: testsuite/hpc_output/hpc_index.html
-# --normal: Default settings
-# --fast: Omit dyn way, omit binary distribution
-# --slow: Build stage2 with -DDEBUG.
-# 2008-07-01: 14% slower than the default.
-
set -e
+show_help () {
+ cat <<EOF
+Usage: $0 [FLAGS]...
+
+Validate GHC source tree against testsuite; see
+http://ghc.haskell.org/trac/ghc/wiki/TestingPatches for more
+information.
+
+Flags:
+ --no-clean don't make clean first, just carry on from
+ a previous interrupted validation run
+ --testsuite-only don't build the compiler, just run the test suite
+ --hpc build stage2 with -fhpc, and see how much of the
+ compiler the test suite covers.
+ 2008-07-01: 63% slower than the default.
+ HTML generated here: testsuite/hpc_output/hpc_index.html
+ --normal Default settings
+ --fast Omit dyn way, omit binary distribution
+ --slow Build stage2 with -DDEBUG.
+ 2008-07-01: 14% slower than the default.
+ --help shows this usage help.
+
+ Set environment variable 'CPUS' to number of cores, to exploit
+ multiple cpu cores, e.g.
+
+ CPUS=8 ./validate
+
+EOF
+}
+
no_clean=0
testsuite_only=0
hpc=NO
@@ -42,8 +58,12 @@ do
--normal)
speed=NORMAL
;;
+ --help)
+ show_help
+ exit 0;;
*)
- echo "Bad argument: $1" >&2
+ echo "$0: unrecognized argument '$1'" >&2
+ echo "Try '$0 --help' for more information." >&2
exit 1;;
esac
shift