From: Ian Lynagh Date: Thu, 31 Dec 2009 15:50:04 +0000 (+0000) Subject: Use a shell script, rather than perl script, to make flags.xsl X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=a74ef5d0b9a5a8db3fe98fb0d671b35970cdc05c;hp=479b0241032c8b02999e0852f63d57fe3584edf9;p=ghc-hetmet.git Use a shell script, rather than perl script, to make flags.xsl --- diff --git a/docs/man/gen_flags.xsl.pl b/docs/man/gen_flags.xsl.sh similarity index 94% rename from docs/man/gen_flags.xsl.pl rename to docs/man/gen_flags.xsl.sh index a331792..28627ea 100644 --- a/docs/man/gen_flags.xsl.pl +++ b/docs/man/gen_flags.xsl.sh @@ -1,15 +1,15 @@ -#!/usr/bin/perl -w +#!/bin/sh -use strict; +if [ "$#" -ne 2 ] +then + echo "Usage: $0 " + exit 1 +fi -if ($#ARGV ne 1) { - die "Usage: $0 \n" -} +GHC_COMMANDS="$1" +LIBDIR="$2" -my @ghc_commands = split / /, $ARGV[0]; -my $libdir = $ARGV[1]; - -print <<'EOF'; +cat <<'EOF' @@ -31,18 +31,22 @@ GHC \- the Glasgow Haskell Compiler .SH SYNOPSIS EOF -my $started = 0; - -for my $ghc_command (@ghc_commands) { - print ".br\n" if $started; - $started = 1; - print <<"EOF"; -.B $ghc_command +STARTED=0 + +for GHC_COMMAND in $GHC_COMMANDS +do + if [ "$STARTED" -ne 0 ] + then + echo ".br" + fi + STARTED=1 + cat < $@ +docs/man/flags.xsl: docs/man/gen_flags.xsl.sh + $(SHELL) $< "$(MAN_GHC_COMMANDS)" "$(libdir)" > $@ # Re-use the flags documentation from the user's guide by injecting some # entities after the XML declaration to make it a stand-alone document.