summaryrefslogtreecommitdiff
path: root/libraries/gen_contents_index
diff options
context:
space:
mode:
authorThomas Dziedzic <gostrc@gmail.com>2012-06-20 21:31:27 -0500
committerPaolo Capriotti <p.capriotti@gmail.com>2012-06-21 09:40:14 +0100
commit2b3734853ae5ddb75f85bfcc4ab8842a9ba4b5e0 (patch)
tree7208070f6ec929a86a57a110a9ccb0a51ca374dc /libraries/gen_contents_index
parent0f085f36f89d5942ce39ca5389a289d9e112d7c1 (diff)
downloadhaskell-2b3734853ae5ddb75f85bfcc4ab8842a9ba4b5e0.tar.gz
Add --verbose and --help flags to gen_contents_index
Fixes http://hackage.haskell.org/trac/ghc/ticket/5992
Diffstat (limited to 'libraries/gen_contents_index')
-rw-r--r--libraries/gen_contents_index37
1 files changed, 30 insertions, 7 deletions
diff --git a/libraries/gen_contents_index b/libraries/gen_contents_index
index b9aaa93e72..5303aa66a3 100644
--- a/libraries/gen_contents_index
+++ b/libraries/gen_contents_index
@@ -2,13 +2,35 @@
set -e
+USAGE="Usage: $0 [--inplace] [--verbose] [--help]"
+INPLACE=
+VERBOSE=
+
HADDOCK_ARGS=
[ -d dist-haddock ] || mkdir dist-haddock
cd dist-haddock
-case $* in
---inplace)
+while [ "$#" -ne "0" ]
+do
+ case "$1" in
+ --inplace)
+ INPLACE=yes
+ ;;
+ --verbose)
+ VERBOSE=yes
+ ;;
+ --help)
+ echo "$USAGE"
+ exit 0
+ ;;
+ esac
+
+ shift
+done
+
+if [ -n "$INPLACE" ]
+then
HADDOCK=../../inplace/bin/haddock
for REPO in `grep '^libraries/[^ ]* *- ' ../../packages | sed -e 's#libraries/##' -e 's/ .*//'`
do
@@ -35,8 +57,7 @@ case $* in
fi
done
done
- ;;
-*)
+else
HADDOCK=../../../../../../bin/haddock
# We don't want the GHC API to swamp the index
HADDOCK_FILES=`ls -1 ../*/*.haddock | grep -v '/ghc\.haddock' | sort`
@@ -46,11 +67,13 @@ case $* in
HADDOCK_ARG="--read-interface=${NAME_VERSION},$HADDOCK_FILE"
HADDOCK_ARGS="$HADDOCK_ARGS $HADDOCK_ARG"
done
- ;;
-esac
+fi
# Now create the combined contents and index pages
-echo $HADDOCK_ARGS
+if [ -n "$VERBOSE" ]
+then
+ echo $HADDOCK_ARGS
+fi
$HADDOCK --gen-index --gen-contents -o . \
-t "Haskell Hierarchical Libraries" \
-p "../prologue.txt" \