Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : ghc-7.4

http://hackage.haskell.org/trac/ghc/changeset/e1e68550026b83ba15158fa776f406844cccedd1

>---------------------------------------------------------------

commit e1e68550026b83ba15158fa776f406844cccedd1
Author: Thomas Dziedzic <[email protected]>
Date:   Wed Jun 20 21:22:44 2012 -0500

    Add --verbose and --help flags to gen_contents_index
    
    Fixes http://hackage.haskell.org/trac/ghc/ticket/5992

>---------------------------------------------------------------

 libraries/gen_contents_index |   37 ++++++++++++++++++++++++++++++-------
 1 files changed, 30 insertions(+), 7 deletions(-)

diff --git a/libraries/gen_contents_index b/libraries/gen_contents_index
index c8d82c8..dde6fbe 100644
--- a/libraries/gen_contents_index
+++ b/libraries/gen_contents_index
@@ -2,10 +2,32 @@
 
 set -e
 
+USAGE="Usage: $0 [--inplace] [--verbose] [--help]"
+INPLACE=
+VERBOSE=
+
 HADDOCK_ARGS=
 
-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
@@ -32,8 +54,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`
@@ -43,11 +64,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" \



_______________________________________________
Cvs-ghc mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to