there have been repeated requests for an offline text version of the flag reference section in the users guide, yet the ticket
http://hackage.haskell.org/trac/ghc/ticket/1226 sounds pessimistic for 6.8.1. presumably, the problem is generating the text to print? i attach a small xsl transformation file that takes a first stab at the job, pulling each entry into a single line, with no special formatting. the output doesn't look like a table, but is very suited to be piped into grep. the only cumbersome part is the use of sed to add the missing entity references (see example calls below), but that could be hidden in whatever makefile does the call. my suggestion would be to use this to generate a .txt file from flags.xml when building a distribution, and to simply add that text file in a standard location to the distributions. then 'ghc --full-flag-help' could simply reproduce that file, hiding the location. relevant for HEAD and STABLE. claus --------------------------------------------------- $ sed 's/\(<?xml version[^>]*>\)/\0\n<!DOCTYPE sect1 \[<!ENTITY ndash "-"> <!ENTITY ldquo "\`"> < !ENTITY rdquo "'\''">\]>/' flags.xml | xsltproc flagref.xsl - | head -40 Flag reference Help and verbosity options Flag | Description | Static/Dynamic | Reverse -? | help | mode | - -help | help | mode | - -n | do a dry run | dynamic | - -v | verbose mode (equivalent to -v3) | dynamic | - -vn | set verbosity level | dynamic | - -V | display GHC version | mode | - --supported-languages | display the supported language extensions | mode | - --info | display information about the compiler | mode | - --version | display GHC version | mode | - --numeric-version | display GHC version (numeric only) | mode | - --print-libdir | display GHC library directory | mode | - --print-docdir | display GHC documentation directory | mode | - -ferror-spans | output full span in error messages | static | - -Hsize | Set the minimum heap size to size | static | - -Rghc-timing | Summarise timing stats for GHC (same as +RTS -tstderr) | static | - Which phases to run Flag | Description | Static/Dynamic | Reverse -E | Stop after preprocessing (.hspp file) | mode | - -C | Stop after generating C (.hc file) | mode | - -S | Stop after generating assembly (.s file) | mode | - -c | Do not link | dynamic | - -x suffix | Override default behaviour for source files | static | - Alternative modes of operation Flag | Description | Static/Dynamic | Reverse --interactive | Interactive mode - normally used by just running ghci; see for details. | mode | - --make | Build a multi-module Haskell program, automatically figuring out dependencies. Likely to be much easier, and faster, than using make; see for details.. | mode | - -e expr | Evaluate expr; see for details. | mode | - -M | Generate dependency information suitable for use in a Makefile; see for details. | mode | - Redirecting output --------------------------------------------------- $ sed 's/\(<?xml version[^>]*>\)/\0\n<!DOCTYPE sect1 \[<!ENTITY ndash "-"> <!ENTITY ldquo "\`"> < !ENTITY rdquo "'\''">\]>/' flags.xml | xsltproc flagref.xsl - | grep dump -ddump-hi | Dump the new interface to stdout | dynamic | - -ddump-hi-diffs | Show the differences vs. the old interface | dynamic | - -ddump-minimal-imports | Dump a minimal set of imports | dynamic | - --show-iface file | Read the interface in file and dump it as text to stdout. | mode | - -fforce-recomp | Turn off recompilation checking; implied by any -ddump-X option | dynamic | -fno- force-recomp -ddump-asm | Dump assembly | dynamic | - -ddump-bcos | Dump interpreter byte code | dynamic | - -ddump-cmm | Dump C-- output | dynamic | - -ddump-cpranal | Dump output from CPR analysis | dynamic | - -ddump-cse | Dump CSE output | dynamic | - -ddump-deriv | Dump deriving output | dynamic | - -ddump-ds | Dump desugarer output | dynamic | - -ddump-flatC | Dump `flat' C | dynamic | - -ddump-foreign | Dump foreign export stubs | dynamic | - -ddump-hpc | Dump after intrumentation for program coverage | dynamic | - -ddump-inlinings | Dump inlining info | dynamic | - -ddump-occur-anal | Dump occurrence analysis output | dynamic | - -ddump-opt-cmm | Dump the results of C-- to C-- optimising passes | dynamic | - -ddump-parsed | Dump parse tree | dynamic | - -ddump-prep | Dump prepared core | dynamic | - -ddump-rn | Dump renamer output | dynamic | - -ddump-rules | Dump rules | dynamic | - -ddump-simpl | Dump final simplifier output | dynamic | - -ddump-simpl-iterations | Dump output from each simplifier iteration | dynamic | - -ddump-spec | Dump specialiser output | dynamic | - -ddump-splices | Dump TH splided expressions, and what they evaluate to | dynamic | - -ddump-stg | Dump final STG | dynamic | - -ddump-stranal | Dump strictness analyser output | dynamic | - -ddump-tc | Dump typechecker output | dynamic | - -ddump-types | Dump type signatures | dynamic | - -ddump-worker-wrapper | Dump worker-wrapper output | dynamic | - -ddump-if-trace | Trace interface files | dynamic | - -ddump-tc-trace | Trace typechecker | dynamic | - -ddump-rn-trace | Trace renamer | dynamic | - -ddump-rn-stats | Renamer stats | dynamic | - -ddump-simpl-stats | Dump simplifier stats | dynamic | - -dppr-noprags | Don't output pragma info in dumps | static | -
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" > <xsl:output method="text" omit-xml-declaration="yes" /> <xsl:template match="/"> <xsl:value-of select="sect1/title"/><xsl:text> </xsl:text> <xsl:for-each select="//sect2"> <xsl:text> </xsl:text> <xsl:value-of select=".//title"/><xsl:text> </xsl:text> <xsl:for-each select=".//row"> <xsl:if test="entry[1]='Flag'"> <xsl:text> </xsl:text> </xsl:if> <xsl:text> </xsl:text> <xsl:value-of select="normalize-space(entry[1])"/> <xsl:text> | </xsl:text> <xsl:value-of select='normalize-space(entry[2])'/> <xsl:text> | </xsl:text> <xsl:value-of select="normalize-space(entry[3])"/> <xsl:text> | </xsl:text> <xsl:value-of select="normalize-space(entry[4])"/> <xsl:text> </xsl:text> </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet>
_______________________________________________ Cvs-ghc mailing list [email protected] http://www.haskell.org/mailman/listinfo/cvs-ghc
