Add some extra paras from the usage message, and make sure they get through. Try harder to control white space in the usage message.

This commit is contained in:
Simon MacMullen 2010-02-26 17:09:54 +00:00
parent 311661f24b
commit 2e278e11eb
2 changed files with 32 additions and 9 deletions

View File

@ -646,6 +646,12 @@
optional <command>vhost</command> parameter. This parameter, if present, must be
specified immediately after the query.
</para>
<para role="usage">
The list_queues, list_exchanges and list_bindings commands accept an
optional virtual host parameter for which to display results. The
default value is "/".
</para>
<variablelist>
<varlistentry role="usage-has-option-list">
<term>list_queues <option>-p <replaceable>vhostpath</replaceable></option> <option role="usage-option-list"><replaceable>queueinfoitem</replaceable> ...</option></term>
@ -816,6 +822,10 @@
name, queue name, routing key and binding arguments, in
that order. Non-ASCII characters will be URL-encoded.
</para>
<para role="usage">
The output format for "list_bindings" is a list of rows containing
exchange name, queue name, routing key and arguments, in that order.
</para>
</listitem>
</varlistentry>
@ -1013,6 +1023,12 @@
indicating whether acknowledgements are expected for
messages delivered to this consumer.
</para>
<para role="usage">
The output format for "list_consumers" is a list of rows containing,
in order, the queue name, channel process id, consumer tag, and a
boolean indicating whether acknowledgements are expected from the
consumer.
</para>
</listitem>
</varlistentry>
</variablelist>

View File

@ -9,7 +9,8 @@
<xsl:output method="text"
encoding="UTF-8"
indent="no"/>
<xsl:strip-space elements="arg"/>
<xsl:strip-space elements="*"/>
<xsl:preserve-space elements="term" />
<xsl:template match="/">
<!-- Pull out cmdsynopsis to show the command usage line. -->Usage:
@ -38,7 +39,7 @@
<!-- Any paragraphs which have been marked as role="usage" (principally for global flags). -->
<xsl:text>&#10;</xsl:text>
<xsl:for-each select="//para[@role='usage']">
<xsl:for-each select=".//*[title='Options']//para[@role='usage']">
<xsl:value-of select="normalize-space(.)"/><xsl:text>&#10;&#10;</xsl:text>
</xsl:for-each>
@ -53,15 +54,21 @@
<xsl:text>&#10;</xsl:text>
</xsl:for-each>
<!-- Any second-level variable lists (for options for subcommands). -->
<xsl:for-each select=".//*[title='Commands']//varlistentry[@role='usage-has-option-list']">
&lt;<xsl:value-of select="term/option[@role='usage-option-list']/replaceable"/>&gt; must be a member of the list [<xsl:for-each select="listitem/variablelist/varlistentry"><xsl:apply-templates select="term"/><xsl:if test="not(position() = last())">, </xsl:if></xsl:for-each>].
</xsl:for-each>
<xsl:apply-templates select=".//*[title='Commands']/refsect2" mode="command-usage" />
</xsl:template>
<xsl:template match="option">[<xsl:apply-templates/>]</xsl:template>
<!-- Option lists in command usage -->
<xsl:template match="varlistentry[@role='usage-has-option-list']" mode="command-usage">&lt;<xsl:value-of select="term/option[@role='usage-option-list']/replaceable"/>&gt; must be a member of the list [<xsl:for-each select="listitem/variablelist/varlistentry"><xsl:apply-templates select="term"/><xsl:if test="not(position() = last())">, </xsl:if></xsl:for-each>].<xsl:text>&#10;&#10;</xsl:text></xsl:template>
<xsl:template match="replaceable">&lt;<xsl:value-of select="normalize-space(.)"/>&gt;</xsl:template>
<!-- Usage paras in command usage -->
<xsl:template match="para[@role='usage']" mode="command-usage">
<xsl:value-of select="normalize-space(.)"/><xsl:text>&#10;&#10;</xsl:text>
</xsl:template>
<!-- Don't show anything else in command usage -->
<xsl:template match="text()" mode="command-usage"/>
<xsl:template match="option">[<xsl:apply-templates/>]</xsl:template>
<xsl:template match="replaceable">&lt;<xsl:value-of select="."/>&gt;</xsl:template>
</xsl:stylesheet>