diff options
| author | Simon MacMullen <simon@lshift.net> | 2010-03-02 13:18:49 +0000 |
|---|---|---|
| committer | Simon MacMullen <simon@lshift.net> | 2010-03-02 13:18:49 +0000 |
| commit | 17f4674365c8840d1b811a45acec47101910dade (patch) | |
| tree | f7b7b1f54423e357479b1df3c8d30fb4a4a8e0bc | |
| parent | 3a7576d1d7e74504ef297bc9e308e7e3752f8b94 (diff) | |
| download | rabbitmq-server-git-17f4674365c8840d1b811a45acec47101910dade.tar.gz | |
Move the prefix / suffix to the XSL file, cleaner and works with echo from lenny.
| -rw-r--r-- | Makefile | 6 | ||||
| -rw-r--r-- | docs/usage.xsl | 8 |
2 files changed, 10 insertions, 4 deletions
@@ -203,9 +203,9 @@ distclean: clean rm -f $<.tmp %.usage.erl: %.1.xml docs/usage.xsl - echo -n "%% Generated, do not edit!\n-module(`basename $< .1.xml | tr -d -`_usage).\n-export([usage/0]).\nusage() -> io:format(\"" > docs/`basename $< .1.xml`.usage.erl - xsltproc docs/usage.xsl $< | sed -e s/\\\"/\\\\\\\"/g | fmt -s >> docs/`basename $< .1.xml`.usage.erl - echo '"), halt(1).' >> docs/`basename $< .1.xml`.usage.erl + xsltproc --stringparam modulename "`basename $< .1.xml | tr -d -`_usage" \ + docs/usage.xsl $< | sed -e s/\\\"/\\\\\\\"/g | sed -e s/%QUOTE%/\\\"/g | \ + fmt -s > docs/`basename $< .1.xml`.usage.erl # This evil with grep and sed is due to the remarkable ugliness otherwise # experienced trying to get XSLT to work with an input doc where all nodes are diff --git a/docs/usage.xsl b/docs/usage.xsl index 25c8e6b3c4..841b2a8461 100644 --- a/docs/usage.xsl +++ b/docs/usage.xsl @@ -6,6 +6,8 @@ exclude-result-prefixes="exsl" version='1.0'> +<xsl:param name="modulename"/> + <xsl:output method="text" encoding="UTF-8" indent="no"/> @@ -13,7 +15,10 @@ <xsl:preserve-space elements="term" /> <xsl:template match="/"> -<!-- Pull out cmdsynopsis to show the command usage line. -->Usage: +<!-- Pull out cmdsynopsis to show the command usage line. -->%% Generated, do not edit! +-module(<xsl:value-of select="$modulename" />). +-export([usage/0]). +usage() -> io:format(%QUOTE%Usage: <xsl:value-of select="refentry/refsynopsisdiv/cmdsynopsis/command"/> <xsl:text> </xsl:text> <xsl:for-each select="refentry/refsynopsisdiv/cmdsynopsis/arg"> @@ -55,6 +60,7 @@ </xsl:for-each> <xsl:apply-templates select=".//*[title='Commands']/refsect2" mode="command-usage" /> +%QUOTE%), halt(1). </xsl:template> <!-- Option lists in command usage --> |
