VirtualBox

Changeset 56466 in vbox


Ignore:
Timestamp:
Jun 16, 2015 11:46:25 PM (10 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
101083
Message:

debugvm manpage, refsect2 titles, bunch of other hacking.

Location:
trunk
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/doc/manual/Makefile.kmk

    r56348 r56466  
    163163## List of refentry files (manpages).
    164164VBOX_MANUAL_XML_REFENTRY_FILES = \
     165        man_VBoxManage_debugvm.xml \
    165166        man_VBoxManage_extpack.xml
    166167
     
    458459$(eval $$(VBOX_PATH_MANUAL_OUTBASE)/$(lang)/user_VBoxManage.xml: $(VBOX_PATH_MANUAL_SRC)/$(lang)/user_VBoxManage.xml \
    459460        $$(addprefix $$(VBOX_PATH_MANUAL_OUTBASE)/$(lang)/,$$(filter man_VBoxManage%,$$(VBOX_MANUAL_XML_REFENTRY_FILES))) \
     461        $$(addprefix $$(VBOX_PATH_MANUAL_OUTBASE)/overview_,$$(filter man_VBoxManage%,$$(VBOX_MANUAL_XML_REFENTRY_FILES))) \
    460462        $(VBOX_PATH_MANUAL_OUTBASE)/user_VBoxManage_CommandsOverview.xml ))
    461463
     
    465467                $(VBOX_PATH_MANUAL_SRC)/% \
    466468               $$(addprefix $$(@D)/,$$(filter man_VBoxManage%,$$(VBOX_MANUAL_XML_REFENTRY_FILES))) \
     469               $$(addprefix $$(@D)/overview_,$$(filter man_VBoxManage%,$$(VBOX_MANUAL_XML_REFENTRY_FILES))) \
    467470                $(VBOX_PATH_MANUAL_OUTBASE)/user_VBoxManage_CommandsOverview.xml \
    468471                $(VBOX_XML_CATALOG) $(VBOX_XML_CATALOG_DOCBOOK) \
    469472                $(VBOXMANAGEHELP_PATH) | $$(dir $$@)
    470473        $(call MSG_L1,Pre-processing [2] $(@F) to $@)
    471         $(QUIET)$(RM) -f $@ [email protected] [email protected]
     474        $(QUIET)$(RM) -f $@ [email protected] [email protected]
     475        $(QUIET)$(REDIRECT) -wo [email protected] -E 'VBOX_LOG_FLAGS=disabled' -E 'VBOX_LOG_DEST=nofile' \
     476                $(if $(eq $(KBUILD_TARGET),darwin), -E 'DYLD_FALLBACK_LIBRARY_PATH=$(dir $(LIB_RUNTIME))') \
     477                -- \
     478                $(VBOXMANAGEHELP_PATH) --dumpopts
    472479        $(QUIET)$(SED) \
     480                -e ':a' \
     481                -e 'N' \
     482                -e '$(DOLLAR)!ba' \
     483                -e 's/</\&lt\;/g' \
     484                -e 's/>/\&gt\;/g' \
     485                -e 's/\n*$(DOLLAR)/<\/screen>/' \
     486                -e 's/^/<screen>/' \
     487                --output [email protected] [email protected]
     488        $(QUIET)$(SED) \
     489                -e '/@VBOX_MANAGE_OUTPUT@/{' -e 'r [email protected]' -e 'd' -e '}' \
     490               \
    473491                -e 's/\$$VBOX_VERSION_MAJOR/$(VBOX_VERSION_MAJOR)/g' \
    474492                -e 's/\$$VBOX_VERSION_MINOR/$(VBOX_VERSION_MINOR)/g' \
     
    480498                -e 's|@VBOX_PATH_DOCBOOK@|$(VBOX_PATH_DOCBOOK)|g' \
    481499                -e 's|@VBOX_PATH_MANUAL_SRC@|$(VBOX_PATH_MANUAL_SRC)|g' \
    482                 --output [email protected] $<
    483         $(QUIET)$(SED) \
    484                 -e '1,/\$$VBOX_MANAGE_OUTPUT/!d' \
    485                 -e 's/\$$VBOX_MANAGE_OUTPUT.*//' \
    486                 --output [email protected] [email protected]
    487         $(QUIET)$(REDIRECT) -wo [email protected] -E 'VBOX_LOG_FLAGS=disabled' -E 'VBOX_LOG_DEST=nofile' \
    488                 $(if $(eq $(KBUILD_TARGET),darwin), -E 'DYLD_FALLBACK_LIBRARY_PATH=$(dir $(LIB_RUNTIME))') \
    489                 -- \
    490                 $(VBOXMANAGEHELP_PATH) --dumpopts
    491         $(QUIET)$(SED) -e 's/</\&lt;/g' -e 's/>/\&gt;/g' --append [email protected] [email protected]
    492         $(QUIET)$(SED) \
    493                 -e '/\$$VBOX_MANAGE_OUTPUT/,$$!d' \
    494                 -e 's/.*\$$VBOX_MANAGE_OUTPUT//' \
    495                 --append [email protected] [email protected]
    496 if 0 # Not currently needed.
    497         $(QUIET)$(VBOX_XSLTPROC_WITH_CAT) --xinclude --nonet --output $@ \
    498                 $(VBOX_PATH_MANUAL_SRC)/usage-to-docbook-manual.xsl \
    499                 [email protected]
    500 else
    501         $(QUIET)$(CP) [email protected] $@
    502 endif
    503         $(QUIET)$(RM) -f [email protected] [email protected] [email protected]
     500                --output "$@" \
     501                "$<"
     502        $(QUIET)$(RM) -f [email protected] [email protected]
    504503
    505504
     
    524523# Generates the VBoxManage command overview include file (shared between
    525524# languages) from the refsynopsisdiv section of the man pages.
    526 $(VBOX_PATH_MANUAL_OUTBASE)/user_VBoxManage_CommandsOverview.xml: \
     525$(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/overview_,$(VBOX_MANUAL_XML_REFENTRY_FILES)): \
    527526                $(VBOX_PATH_MANUAL_SRC)/docbook-refentry-to-manual-overview.xsl \
    528                 $(addprefix $(VBOX_PATH_MANUAL_SRC)/en_US/,$(filter man_VBoxManage_%,$(VBOX_MANUAL_XML_REFENTRY_FILES))) \
     527                $$(patsubst overview_%,$$(VBOX_PATH_MANUAL_SRC)/en_US/%,$$(notdir $$@)) \
    529528                $(VBOX_XML_CATALOG) $(VBOX_XML_CATALOG_DOCBOOK) \
    530529               | $$(dir $$@)
    531         $(call MSG_GENERATE,,$@,en_US/man_VBoxManage_*.xml)
    532         $(QUIET)$(RM) -f -- "$@"
    533         $(QUIET)$(VBOX_XSLTPROC_WITH_CAT) --xinclude --nonet --output "$@" \
    534                 $(VBOX_PATH_MANUAL_SRC)/docbook-refentry-to-manual-overview.xsl \
    535                 $(addprefix $(VBOX_PATH_MANUAL_SRC)/en_US/,$(filter man_VBoxManage_%,$(VBOX_MANUAL_XML_REFENTRY_FILES)))
     530        $(call MSG_GENERATE,,$@,$(filter %.xml,$^))
     531        $(QUIET)$(VBOX_XSLTPROC_WITH_CAT) --xinclude --nonet --output "$@" $< $(filter %.xml,$^)
     532
     533$(VBOX_PATH_MANUAL_OUTBASE)/user_VBoxManage_CommandsOverview.xml: $(MAKEFILE_CURRENT) | $$(dir $$@)
     534        $(call MSG_GENERATE,,$@,)
     535        $(QUIET)$(APPEND) -tn "$@" \
     536                '<?xml version="1.0" encoding="UTF-8"?>' \
     537               '<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">' \
     538               '<remark role="VBoxManage-overview">' \
     539               $(foreach refentry, $(filter man_VBoxManage%,$(VBOX_MANUAL_XML_REFENTRY_FILES)) \
     540                , '  <xi:include href="overview_$(refentry)" xpointer="element(/1)" xmlns:xi="http://www.w3.org/2001/XInclude" />') \
     541               '</remark>'
     542
    536543
    537544
     
    646653                --output $@ [email protected]
    647654        $(QUIET)$(RM) -f [email protected]
     655
     656# Useful aliases
     657usermanual UserManual.pdf:: $(PATH_STAGE_BIN)/UserManual.pdf
     658
     659debug-usermanual:
     660        $(MAKE) --pretty-command-printing -j1 VBOX_PDFLATEX_INTERACTION=errorstopmode $(PATH_STAGE_BIN)/UserManual.pdf
    648661
    649662
  • trunk/doc/manual/docbook-refentry-to-C-help.xsl

    r56444 r56466  
    4040  <xsl:template match="refentry">
    4141    <!-- Assert refetry expectations. -->
    42     <xsl:if test="not(./refsynopsisdiv)">     <xsl:message terminate="yes">refentry must have a refsynopsisdiv</xsl:message></xsl:if>
    43     <xsl:if test="not(./refentryinfo/title)"> <xsl:message terminate="yes">refentry must have a refentryinfo with title</xsl:message></xsl:if>
    44     <xsl:if test="not(./refsect1/title)">     <xsl:message terminate="yes">refentry must have a refsect1 with title</xsl:message></xsl:if>
    45     <xsl:if test="not(@id) or @id = ''">      <xsl:message terminate="yes">refentry must have an id attribute</xsl:message></xsl:if>
     42    <xsl:if test="not(./refsynopsisdiv)">
     43        <xsl:message terminate="yes">refentry must have a refsynopsisdiv</xsl:message>
     44    </xsl:if>
     45    <xsl:if test="not(./refentryinfo/title)">
     46      <xsl:message terminate="yes">refentry must have a refentryinfo with title</xsl:message>
     47    </xsl:if>
     48    <xsl:if test="not(./refmeta/refentrytitle)">
     49      <xsl:message terminate="yes">refentry must have a refentryinfo with title</xsl:message>
     50    </xsl:if>
     51    <xsl:if test="./refmeta/refentrytitle != ./refnamediv/refname">
     52      <xsl:message terminate="yes">The refmeta/refentrytitle and the refnamediv/refname must be identical</xsl:message>
     53    </xsl:if>
     54    <xsl:if test="not(./refsect1/title)">
     55      <xsl:message terminate="yes">refentry must have a refsect1 with title</xsl:message>
     56    </xsl:if>
     57    <xsl:if test="not(@id) or @id = ''">
     58      <xsl:message terminate="yes">refentry must have an id attribute</xsl:message>
     59    </xsl:if>
    4660
    4761    <!-- variables -->
     
    208222    <!-- assertions -->
    209223    <xsl:if test="text()"><xsl:message terminate="yes">refsect2 shouldn't contain text</xsl:message></xsl:if>
    210     <xsl:if test="count(./cmdsynopsis) > 1"><xsl:message terminate="yes">Only a single cmdsynopsis is currently supported in a refsect2.</xsl:message></xsl:if>
    211     <xsl:if test="count(./title) > 1"><xsl:message terminate="yes">Only a single title in refsect2</xsl:message></xsl:if>
     224    <xsl:if test="count(./title) != 1"><xsl:message terminate="yes">refsect2 requires a title (<xsl:value-of select="ancestor-or-self::*[@id][1]/@id"/>)</xsl:message></xsl:if>
    212225
    213226    <!-- title / command synopsis - sets the scope. -->
     
    216229    {   REFENTRYSTR_SCOPE_SAME,
    217230        "</xsl:text><xsl:call-template name="emit-indentation"/>
    218     <xsl:choose>
    219       <xsl:when test="name(./*[1]) = 'cmdsynopsis'">
    220         <!--xsl:text>* </xsl:text-->
    221         <xsl:apply-templates select="./cmdsynopsis/node()|./cmdsynopsis/@*"/>
    222       </xsl:when>
    223       <xsl:when test="name(./*[1]) = 'title'">
    224         <xsl:apply-templates select="./title/text()"/>
    225       </xsl:when>
    226       <xsl:otherwise>
    227         <xsl:message terminate="yes">Expected either a title or cmdsynopsis as the first element in a refsect2.
    228             (Put scoping remarks after.)</xsl:message>
    229       </xsl:otherwise>
    230     </xsl:choose>
     231    <xsl:apply-templates select="./title/text()"/>
    231232    <xsl:text>" },</xsl:text>
    232233
    233234    <!-- Format the text in the section -->
    234     <xsl:apply-templates select="./*[position() > 1]"/>
     235    <xsl:for-each select="./*[name() != 'title']">
     236      <xsl:choose>
     237        <xsl:when test="self::remark[@scope = 'help-copy-synopsis']">
     238          <xsl:variable name="sSrcId" select="concat('synopsis-', @condition)"/>
     239          <xsl:if test="not(/refentry/refsynopsisdiv/cmdsynopsis[@id = $sSrcId])">
     240            <xsl:message terminate="yes">Could not find any cmdsynopsis with id=<xsl:value-of select="$sSrcId"/> in refsynopsisdiv.</xsl:message>
     241          </xsl:if>
     242          <xsl:apply-templates select="/refentry/refsynopsisdiv/cmdsynopsis[@id = $sSrcId]"/>
     243        </xsl:when>
     244        <xsl:otherwise>
     245          <xsl:apply-templates select="."/>
     246        </xsl:otherwise>
     247      </xsl:choose>
     248    </xsl:for-each>
    235249
    236250    <!-- Add two blank lines, unless we're the last element in this refsect1. -->
     
    433447
    434448  <!--
     449    Fail on misplaced scoping remarks.
     450    -->
     451  <xsl:template match="remark[@role = 'help-copy-synopsis']">
     452    <xsl:choose>
     453      <xsl:when test="parent::refsect2"/>
     454      <xsl:otherwise>
     455        <xsl:message terminate="yes">Misplaced remark/@role=help-copy-synopsis element.
     456Only supported on: refsect2</xsl:message>
     457      </xsl:otherwise>
     458    </xsl:choose>
     459  </xsl:template>
     460
     461  <!--
    435462    Warn about unhandled elements
    436463    -->
    437464  <xsl:template match="*">
    438     <xsl:message terminate="no">Warning: Unhandled element: <xsl:value-of select="name(.)"/></xsl:message>
     465    <xsl:message terminate="no">Warning: Unhandled element: <!-- no newline -->
     466      <xsl:for-each select="ancestor-or-self::*">
     467        <xsl:text>/</xsl:text>
     468        <xsl:value-of select="name(.)"/>
     469        <xsl:if test="@id">
     470          <xsl:value-of select="concat('[id=', @id ,']')"/>
     471        </xsl:if>
     472      </xsl:for-each>
     473    </xsl:message>
    439474  </xsl:template>
    440475
  • trunk/doc/manual/docbook-refentry-to-manual-overview.xsl

    r56262 r56466  
    4242
    4343<!--
    44   Translate the refsynopsisdiv into a refsect1. There is special handling
    45   of this in the HTML CSS and in the latex conversion XSLT.
    46   -->
     44  Combine all cmdsynopsis lines into a bunch of commands.
     45 -->
    4746<xsl:template match="refsynopsisdiv">
    48   <refsect1>
    49      <xsl:apply-templates select="node()|@*"/>
    50   </refsect1>
     47  <xsl:if test="not(cmdsynopsis)">
     48    <xsl:message terminate="yes">What? No cmdsynopsis in the refsynopsisdiv?</xsl:message>
     49  </xsl:if>
     50  <xsl:element name="cmdsynopsis">
     51    <xsl:attribute name="id"><xsl:value-of select="/refentry/@id"/><xsl:text>-overview</xsl:text></xsl:attribute>
     52    <xsl:for-each select="cmdsynopsis">
     53      <xsl:copy-of select="node()"/>
     54    </xsl:for-each>
     55  </xsl:element>
    5156</xsl:template>
    5257
  • trunk/doc/manual/docbook-refentry-to-manual-sect1.xsl

    r56441 r56466  
    8989</xsl:template>
    9090
     91<!-- help-copy-synopsis - used in refsect2 to copy synopsis from the refsynopsisdiv. -->
     92<xsl:template match="remark[@role = 'help-copy-synopsis']">
     93  <xsl:if test="not(parent::refsect2)">
     94    <xsl:message terminate="yes">The help-copy-synopsis remark is only applicable in refsect2.</xsl:message>
     95  </xsl:if>
     96  <xsl:variable name="sSrcId" select="concat('synopsis-',../@id)"/>
     97  <xsl:if test="not(/refentry/refsynopsisdiv/cmdsynopsis[@id = $sSrcId])">
     98    <xsl:message terminate="yes">Could not find any cmdsynopsis with id=<xsl:value-of select="$sSrcId"/> in refsynopsisdiv.</xsl:message>
     99  </xsl:if>
     100  <xsl:element name="cmdsynopsis">
     101    <xsl:copy-of select="/refentry/refsynopsisdiv/cmdsynopsis[@id = $sSrcId]/node()"/>
     102  </xsl:element>
     103</xsl:template>
    91104
    92105<!--
  • trunk/doc/manual/docbook2latex.xsl

    r56363 r56466  
    293293        <xsl:text>&#x0a;</xsl:text>
    294294        <xsl:value-of select="$texcmd"/>
    295         <xsl:text>[</xsl:text> <!-- for toc -->
    296         <xsl:apply-templates />
    297         <xsl:text>]</xsl:text>
     295        <xsl:if test="not(contains($texcmd, '*'))">
     296          <xsl:text>[</xsl:text> <!-- for toc -->
     297          <xsl:apply-templates />
     298          <xsl:text>]</xsl:text>
     299        </xsl:if>
    298300        <xsl:text>{</xsl:text> <!-- for doc -->
    299301        <xsl:text>\raisebox{\ht\strutbox}{\hypertarget{</xsl:text>
     
    349351      <xsl:when test="name(..)='refsect1'">
    350352        <xsl:call-template name="title-wrapper">
    351           <xsl:with-param name="texcmd">\paragraph</xsl:with-param>
     353          <xsl:with-param name="texcmd">\subsection*</xsl:with-param>
    352354        </xsl:call-template>
    353         <xsl:text>&#x0a;\begin{addmargin}{1em}&#x0a;</xsl:text> <!-- addmargin is ended by refsect1 template way further down. -->
    354355      </xsl:when>
    355356      <xsl:when test="name(..)='refsect2'">
    356357        <xsl:call-template name="title-wrapper">
    357           <xsl:with-param name="texcmd">\subparagraph</xsl:with-param>
     358          <xsl:with-param name="texcmd">\subsubsection*</xsl:with-param>
    358359        </xsl:call-template>
    359360      </xsl:when>
     
    644645    <xsl:if test="title"><xsl:message terminate="yes">No title element supported in refsynopsisdiv</xsl:message></xsl:if>
    645646    <xsl:call-template name="xsltprocNewlineOutputHack"/>
    646     <xsl:text>&#x0a;\paragraph{Synopsis} \hfill \\&#x0a;\begin{addmargin}{1em}&#x0a;</xsl:text>
    647     <xsl:apply-templates />
    648     <xsl:text>\end{addmargin}&#x0a;</xsl:text>
     647    <xsl:text>&#x0a;\subsection*{Synopsis}</xsl:text>
     648    <xsl:if test="name(*[1]) != 'cmdsynopsis'"> <!-- just in case -->
     649      <xsl:text>\hfill \\&#x0a;</xsl:text>
     650    </xsl:if>
     651    <xsl:text>&#x0a;</xsl:text>
     652    <xsl:apply-templates />
    649653  </xsl:template>
    650654
     
    652656    The refsect1 is used for 'Description' and such. Do same as with refsynopsisdiv
    653657    and turn it into a named & indented paragraph.
    654 
    655     Note! If the section has a title, the title template way up above will begin
    656           the addmargin stuff.  We'll just end it here.
    657           If there is no title, we ASSUME (HACK ALERT) that this is part of the
    658           VBoxManage Command Overview section in the manual.
    659658    -->
    660659  <xsl:template match="refsect1">
    661     <xsl:if test="(name(*[1]) != 'title' and name(*[1]) != 'cmdsynopsis') or not(title) = not(cmdsynopsis)">
    662       <xsl:message terminate="yes">Expected title or cmdsynopsis element as the first child of refsect1.</xsl:message>
    663     </xsl:if>
    664     <xsl:if test="not(title)">
    665       <xsl:call-template name="xsltprocNewlineOutputHack"/>
    666       <xsl:text>&#x0a;\begin{addmargin}{1em}&#x0a;</xsl:text>
     660    <xsl:if test="name(*[1]) != 'title' or count(title) != 1">
     661      <xsl:message terminate="yes">Expected exactly one title as the first refsect1 element (remarks goes after title!).</xsl:message>
    667662    </xsl:if>
    668663    <xsl:apply-templates/>
    669     <xsl:text>&#x0a;\end{addmargin}&#x0a;</xsl:text>
    670664  </xsl:template>
    671665
     
    677671    -->
    678672  <xsl:template match="refsect2">
    679     <xsl:if test="(name(*[1]) != 'title' and name(*[1]) != 'cmdsynopsis') or not(title) = not(cmdsynopsis)">
    680       <xsl:message terminate="yes">Expected title or cmdsynopsis element as the first child of refsect2.</xsl:message>
    681     </xsl:if>
    682     <xsl:if test="not(title)">
    683       <xsl:call-template name="xsltprocNewlineOutputHack"/>
    684       <xsl:text>\vspace{1.2em}&#x0a;</xsl:text>
     673    <xsl:if test="name(*[1]) != 'title' or count(title) != 1">
     674      <xsl:message terminate="yes">Expected exactly one title as the first refsect2 element (remarks goes after title!).</xsl:message>
    685675    </xsl:if>
    686676    <xsl:apply-templates/>
     
    691681  <!--
    692682    Command Synopsis elements.
     683
     684    We treat each command element inside a cmdsynopsis as the start of
     685    a new paragraph.  The DocBook HTML converter does so too, but the
     686    manpage one doesn't.
     687
     688    sbr and linebreaks made by latex should be indented from the base
     689    command level. This is done by the \hangindent3em\hangafter1 bits.
     690
     691    We exploit the default paragraph indentation to get each command
     692    indented from the left margin.  This, unfortunately, doesn't work
     693    if we're the first paragraph in a (sub*)section.  \noindent cannot
     694    counter this due to when latex enforces first paragraph stuff. Since
     695    it's tedious to figure out when we're in the first paragraph and when
     696    not, we just do \noindent\hspace{1em} everywhere.
    693697    -->
    694698  <xsl:template match="sbr">
     699    <xsl:if test="not(ancestor::cmdsynopsis)">
     700      <xsl:message terminate="yes">sbr only supported inside cmdsynopsis (because of hangindent)</xsl:message>
     701    </xsl:if>
    695702    <xsl:text>\linebreak</xsl:text>
    696703  </xsl:template>
     704
    697705  <xsl:template match="refentry|refnamediv|refentryinfo|refmeta|refsect3|refsect4|refsect5|synopfragment|synopfragmentref|cmdsynopsis/info">
    698706    <xsl:message terminate="yes"><xsl:value-of select="name()"/> is not supported</xsl:message>
     
    700708
    701709  <xsl:template match="cmdsynopsis">
    702     <xsl:text>&#x0a;\noindent\texttt{</xsl:text>
    703     <xsl:apply-templates />
    704     <xsl:text>}\linebreak</xsl:text>
    705   </xsl:template>
    706 
    707   <xsl:template match="replaceable">
    708     <xsl:choose>
    709       <xsl:when test="not(ancestor::cmdsynopsis)">
    710         <xsl:text>\texttt{\textit{</xsl:text>
    711         <xsl:apply-templates />
    712         <xsl:text>}}</xsl:text>
    713       </xsl:when>
    714       <xsl:otherwise>
    715         <xsl:text>\textit{</xsl:text>
     710    <xsl:if test="preceding-sibling::cmdsynopsis">
     711      <xsl:text>\par%cmdsynopsis</xsl:text>
     712    </xsl:if>
     713    <xsl:text>&#x0a;</xsl:text>
     714    <xsl:if test="parent::remark[@role='VBoxManage-overview']">
     715      <!-- Overview fontsize trick -->
     716      <xsl:text>{\footnotesize</xsl:text>
     717    </xsl:if>
     718    <xsl:text>\noindent\hspace{1em}</xsl:text>
     719    <xsl:text>\hangindent3em\hangafter1\texttt{</xsl:text>
     720    <xsl:apply-templates />
     721    <xsl:text>}</xsl:text>
     722    <xsl:if test="following-sibling::*">
     723    </xsl:if>
     724
     725    <!-- For refsect2 subcommand descriptions. -->
     726    <xsl:if test="not(following-sibling::cmdsynopsis) and position() != last()">
     727      <xsl:text>\linebreak</xsl:text>
     728    </xsl:if>
     729    <!-- Special overview trick for the current VBoxManage command overview. -->
     730    <xsl:if test="parent::remark[@role='VBoxManage-overview']">
     731      <xsl:text>}\vspace{1em}</xsl:text>
     732    </xsl:if>
     733  </xsl:template>
     734
     735  <xsl:template match="command">
     736    <xsl:choose>
     737      <xsl:when test="ancestor::cmdsynopsis">
     738        <!-- Trigger a line break if this isn't the first command in a the synopsis -->
     739        <xsl:if test="preceding-sibling::command">
     740          <xsl:text>}\par%command&#x0a;</xsl:text>
     741          <xsl:text>\noindent\hspace{1em}</xsl:text>
     742          <xsl:text>\hangindent3em\hangafter1\texttt{</xsl:text>
     743        </xsl:if>
     744        <xsl:apply-templates />
     745      </xsl:when>
     746      <xsl:otherwise>
     747        <xsl:text>\texttt{</xsl:text>
    716748        <xsl:apply-templates />
    717749        <xsl:text>}</xsl:text>
     
    720752  </xsl:template>
    721753
    722   <xsl:template match="command|option">
    723     <xsl:choose>
    724       <xsl:when test="not(ancestor::cmdsynopsis)">
     754  <xsl:template match="option">
     755    <xsl:choose>
     756      <xsl:when test="ancestor::cmdsynopsis">
     757        <xsl:apply-templates />
     758      </xsl:when>
     759      <xsl:otherwise>
    725760        <xsl:text>\texttt{</xsl:text>
    726761        <xsl:apply-templates />
    727762        <xsl:text>}</xsl:text>
    728       </xsl:when>
    729       <xsl:otherwise>
    730         <xsl:apply-templates />
    731763      </xsl:otherwise>
    732764    </xsl:choose>
     
    760792      <xsl:when test="@choice = 'opt' or not(@choice) or @choice = ''"> <xsl:text>]</xsl:text></xsl:when>
    761793      <xsl:when test="@choice = 'req'">                                 <xsl:text>}</xsl:text></xsl:when>
     794    </xsl:choose>
     795  </xsl:template>
     796
     797  <xsl:template match="replaceable">
     798    <xsl:choose>
     799      <xsl:when test="not(ancestor::cmdsynopsis)">
     800        <xsl:text>\texttt{\textit{</xsl:text>
     801        <xsl:apply-templates />
     802        <xsl:text>}}</xsl:text>
     803      </xsl:when>
     804      <xsl:otherwise>
     805        <xsl:text>\textit{</xsl:text>
     806        <xsl:apply-templates />
     807        <xsl:text>}</xsl:text>
     808      </xsl:otherwise>
    762809    </xsl:choose>
    763810  </xsl:template>
  • trunk/doc/manual/en_US/man_VBoxManage_debugvm.xml

    r56445 r56466  
    141141
    142142    <refsect2 id="vboxmanage-debugvm-dumpvmcore">
    143       <cmdsynopsis>
    144         <command>VBoxManage debugvm</command>
    145         <arg choice="req"><replaceable>uuid|vmname</replaceable></arg>
    146         <arg choice="plain">dumpvmcore</arg>
    147         <arg>--filename <replaceable>name</replaceable></arg>
    148       </cmdsynopsis>
     143      <title>VBoxManage debugvm dumpvmcore</title>
     144      <remark role="help-copy-synopsis"/>
    149145      <para>
    150146        Creates a system dump file of the specified VM.  This file will have
     
    164160
    165161    <refsect2 id="vboxmanage-debugvm-info">
    166       <cmdsynopsis>
    167         <command>VBoxManage debugvm</command>
    168         <arg choice="req"><replaceable>uuid|vmname</replaceable></arg>
    169         <arg choice="plain">info</arg>
    170         <arg choice="req"><replaceable>item</replaceable></arg>
    171         <arg rep="repeat"><replaceable>args</replaceable></arg>
    172       </cmdsynopsis>
     162      <title>VBoxManage debugvm info</title>
     163      <remark role="help-copy-synopsis"/>
    173164      <para>
    174165        Displays info items relating to the VMM, device emulations and
     
    199190
    200191    <refsect2 id="vboxmanage-debugvm-injectnmi">
    201       <cmdsynopsis>
    202         <command>VBoxManage debugvm</command>
    203         <arg choice="req"><replaceable>uuid|vmname</replaceable></arg>
    204         <arg choice="plain">injectnmi</arg>
    205       </cmdsynopsis>
     192      <title>VBoxManage debugvm injectnmi</title>
     193      <remark role="help-copy-synopsis"/>
    206194      <para>
    207195        Causes a non-maskable interrupt (NMI) to be injected into the guest. This
     
    213201
    214202    <refsect2 id="vboxmanage-debugvm-log">
    215       <cmdsynopsis>
    216         <command>VBoxManage debugvm</command>
    217         <arg choice="req"><replaceable>uuid|vmname</replaceable></arg>
    218         <arg choice="plain">log</arg>
    219         <group><arg>--release</arg><arg>--debug</arg></group>
    220         <arg rep="repeat"><replaceable>group-settings</replaceable></arg>
    221       </cmdsynopsis>
     203      <title>VBoxManage debugvm log</title>
     204      <remark role="help-copy-synopsis"/>
    222205      <para>
    223206        TODO
     
    226209
    227210    <refsect2 id="vboxmanage-debugvm-logdest">
    228       <cmdsynopsis>
    229         <command>VBoxManage debugvm</command>
    230         <arg choice="req"><replaceable>uuid|vmname</replaceable></arg>
    231         <arg choice="plain">logdest</arg>
    232         <group><arg>--release</arg><arg>--debug</arg></group>
    233         <arg rep="repeat"><replaceable>destinations</replaceable></arg>
    234       </cmdsynopsis>
     211      <title>VBoxManage debugvm logdest</title>
     212      <remark role="help-copy-synopsis"/>
    235213      <para>
    236214        TODO
     
    239217
    240218    <refsect2 id="vboxmanage-debugvm-logflags">
    241       <cmdsynopsis>
    242         <command>VBoxManage debugvm</command>
    243         <arg choice="req"><replaceable>uuid|vmname</replaceable></arg>
    244         <arg choice="plain">logflags</arg>
    245         <group><arg>--release</arg><arg>--debug</arg></group>
    246         <arg rep="repeat"><replaceable>flags</replaceable></arg>
    247       </cmdsynopsis>
     219      <title>VBoxManage debugvm logflags</title>
     220      <remark role="help-copy-synopsis"/>
    248221      <para>
    249222        TODO
     
    252225
    253226    <refsect2 id="vboxmanage-debugvm-osdetect">
    254       <cmdsynopsis>
    255         <command>VBoxManage debugvm</command>
    256         <arg choice="req"><replaceable>uuid|vmname</replaceable></arg>
    257         <arg choice="plain">osdetect</arg>
    258       </cmdsynopsis>
     227      <title>VBoxManage debugvm osdetect</title>
     228      <remark role="help-copy-synopsis"/>
    259229      <para>
    260230        Make the VMM's debugger facility (re)-detect the guest operating system (OS).
     
    267237
    268238    <refsect2 id="vboxmanage-debugvm-osinfo">
    269       <cmdsynopsis>
    270         <command>VBoxManage debugvm</command>
    271         <arg choice="req"><replaceable>uuid|vmname</replaceable></arg>
    272         <arg choice="plain">osinfo</arg>
    273       </cmdsynopsis>
     239      <title>VBoxManage debugvm osinfo</title>
     240      <remark role="help-copy-synopsis"/>
    274241      <para>
    275242        Displays information about the guest operating system (OS) previously
     
    279246
    280247    <refsect2 id="vboxmanage-debugvm-osdmesg">
    281       <cmdsynopsis>
    282         <command>VBoxManage debugvm</command>
    283         <arg choice="req"><replaceable>uuid|vmname</replaceable></arg>
    284         <arg choice="plain">osdmesg</arg>
    285         <arg>--lines <replaceable>lines</replaceable></arg>
    286       </cmdsynopsis>
     248      <title>VBoxManage debugvm osdmesg</title>
     249      <remark role="help-copy-synopsis"/>
    287250      <para>
    288251        Displays the guest OS kernel log, if detected and supported.
     
    298261
    299262    <refsect2 id="vboxmanage-debugvm-getregisters">
    300       <cmdsynopsis>
    301         <command>VBoxManage debugvm</command>
    302         <arg choice="req"><replaceable>uuid|vmname</replaceable></arg>
    303         <arg choice="plain">getregisters</arg>
    304         <arg>--cpu <replaceable>id</replaceable></arg>
    305         <arg rep="repeat"><replaceable>reg-set.reg-name</replaceable></arg>
    306       </cmdsynopsis>
     263      <title>VBoxManage debugvm getregisters</title>
     264      <remark role="help-copy-synopsis"/>
    307265      <para>
    308266        Retrieves register values for guest CPUs and emulated devices.
     
    333291
    334292    <refsect2 id="vboxmanage-debugvm-setregisters">
    335       <cmdsynopsis>
    336         <command>VBoxManage debugvm</command>
    337         <arg choice="req"><replaceable>uuid|vmname</replaceable></arg>
    338         <arg choice="plain">setregisters</arg>
    339         <arg>--cpu <replaceable>id</replaceable></arg>
    340         <arg rep="repeat"><replaceable>reg-set.reg-name=value</replaceable></arg>
    341       </cmdsynopsis>
     293      <title>VBoxManage debugvm setregisters</title>
     294      <remark role="help-copy-synopsis"/>
    342295      <para>
    343296        Changes register values for guest CPUs and emulated devices.
     
    368321
    369322    <refsect2 id="vboxmanage-debugvm-show">
    370       <cmdsynopsis>
    371         <command>VBoxManage debugvm</command>
    372         <arg choice="req"><replaceable>uuid|vmname</replaceable></arg>
    373         <arg choice="plain">show</arg>
    374         <group><arg>--human-readable</arg><arg>--sh-export</arg><arg>--sh-eval</arg><arg>--cmd-set</arg></group>
    375         <arg rep="repeat"><replaceable>settings-item</replaceable></arg>
    376       </cmdsynopsis>
     323      <title>VBoxManage debugvm show</title>
     324      <remark role="help-copy-synopsis"/>
    377325      <para>
    378326        TODO
     
    381329
    382330    <refsect2 id="vboxmanage-debugvm-statistics">
    383       <cmdsynopsis>
    384         <command>VBoxManage debugvm</command>
    385         <arg choice="req"><replaceable>uuid|vmname</replaceable></arg>
    386         <arg choice="plain">statistics</arg>
    387         <arg>--reset</arg>
    388         <arg>--descriptions</arg>
    389         <arg>--pattern <replaceable>pattern</replaceable></arg>
    390       </cmdsynopsis>
     331      <title>VBoxManage debugvm statistics</title>
     332      <remark role="help-copy-synopsis"/>
    391333      <para>
    392334        Displays or resets VMM statistics.
  • trunk/doc/manual/en_US/man_VBoxManage_extpack.xml

    r56434 r56466  
    5252
    5353    <refsect2 id="vboxmanage-extpack-install">
    54       <cmdsynopsis>
    55         <command>VBoxManage extpack install</command>
    56         <arg>--replace</arg>
    57         <arg choice="req"><replaceable>tarball</replaceable></arg>
    58       </cmdsynopsis>
     54      <title>VBoxManage extpack install</title>
     55      <remark role="help-copy-synopsis"/>
    5956      <para>
    6057        Installs a new extension pack on the system.  This command will fail if an older
     
    7774
    7875    <refsect2 id="vboxmanage-extpack-uninstall">
    79       <cmdsynopsis>
    80         <command>VBoxManage extpack uninstall</command>
    81         <arg>--force</arg>
    82         <arg choice="req"><replaceable>name</replaceable></arg>
    83       </cmdsynopsis>
     76      <title>VBoxManage extpack uninstall</title>
     77      <remark role="help-copy-synopsis"/>
    8478      <para>
    8579        Uninstalls an extension pack from the system.  The subcommand will also succeed
     
    10599
    106100    <refsect2 id="vboxmanage-extpack-cleanup">
    107       <cmdsynopsis>
    108         <command>VBoxManage extpack cleanup</command>
    109       </cmdsynopsis>
     101      <title>VBoxManage extpack cleanup</title>
     102      <remark role="help-copy-synopsis"/>
    110103      <para>
    111104        Used to remove temporary files and directories that may have been left behind
  • trunk/doc/manual/en_US/user_VBoxManage.xml

    r56451 r56466  
    158158    for the commands available on your particular host.</para>
    159159
    160     <screen>$VBOX_MANAGE_OUTPUT</screen>
     160    <screen>@VBOX_MANAGE_OUTPUT@</screen> <!-- the whole line is replaced later -->
    161161    <xi:include href="../user_VBoxManage_CommandsOverview.xml" xpointer="element(/1)"
    162162      xmlns:xi="http://www.w3.org/2001/XInclude" />
     
    42544254  </sect1>
    42554255
    4256   <sect1 id="vboxmanage-debugvm">
    4257     <title>VBoxManage debugvm</title>
    4258 
    4259     <para>The "debugvm" commands are for experts who want to tinker with the
    4260     exact details of virtual machine execution. Like the VM debugger described
    4261     in <xref linkend="ts_debugger" />, these commands are only useful if you are
    4262     very familiar with the details of the PC architecture and how to debug
    4263     software.</para>
    4264 
    4265     <para>The subcommands of "debugvm" all operate on a running virtual
    4266     machine. The following are available:<itemizedlist>
    4267         <listitem>
    4268           <para>With <computeroutput>dumpguestcore --filename
    4269           &lt;name&gt;</computeroutput>, you can create a system dump of the
    4270           running VM, which will be written into the given file. This file
    4271           will have the standard ELF core format (with custom sections); see
    4272           <xref linkend="ts_guest-core-format" />.</para>
    4273 
    4274           <para>This corresponds to the
    4275           <computeroutput>writecore</computeroutput> command in the debugger.
    4276           </para>
    4277         </listitem>
    4278 
    4279         <listitem>
    4280           <para>The <computeroutput>info</computeroutput> command is used to
    4281           display info items relating to the VMM, device emulations and
    4282           associated drivers.  This command takes one or two arguments: the
    4283           name of the info item, optionally followed by a string containing
    4284           arguments specific to the info item.
    4285           The <computeroutput>help</computeroutput> info item provides a
    4286           listning of the available items and hints about any optional
    4287           arguments.</para>
    4288 
    4289           <para>This corresponds to the <computeroutput>info</computeroutput>
    4290           command in the debugger.</para>
    4291         </listitem>
    4292 
    4293         <listitem>
    4294           <para>The <computeroutput>injectnmi</computeroutput> command causes
    4295           a non-maskable interrupt (NMI) in the guest, which might be useful
    4296           for certain debugging scenarios. What happens exactly is dependent
    4297           on the guest operating system, but an NMI can crash the whole guest
    4298           operating system. Do not use unless you know what you're
    4299           doing.</para>
    4300         </listitem>
    4301 
    4302         <listitem>
    4303           <para>The <computeroutput>osdetect</computeroutput> command makes the
    4304           VMM's debugger facility (re-)detection the guest operation
    4305           system.</para>
    4306 
    4307           <para>This corresponds to the <computeroutput>detect</computeroutput>
    4308           command in the debugger.</para>
    4309         </listitem>
    4310 
    4311         <listitem>
    4312           <para>The <computeroutput>osinfo</computeroutput> command is used to
    4313           display info about the operating system (OS) detected by the VMM's
    4314           debugger facility.</para>
    4315         </listitem>
    4316 
    4317         <listitem>
    4318           <para>The <computeroutput>getregisters</computeroutput> command is
    4319           used to display CPU and device registers.  The command takes a list
    4320           of registers, each having one of the following forms:
    4321           <itemizedlist>
    4322             <listitem><para><computeroutput>register-set.register-name.sub-field</computeroutput></para></listitem>
    4323             <listitem><para><computeroutput>register-set.register-name</computeroutput></para></listitem>
    4324             <listitem><para><computeroutput>cpu-register-name.sub-field</computeroutput></para></listitem>
    4325             <listitem><para><computeroutput>cpu-register-name</computeroutput></para></listitem>
    4326             <listitem><para><computeroutput>all</computeroutput></para></listitem>
    4327           </itemizedlist>
    4328           The <computeroutput>all</computeroutput> form will cause all
    4329           registers to be shown (no sub-fields).  The registers names are
    4330           case-insensitive.  When requesting a CPU register the register set
    4331           can be omitted, it will be selected using the value of the
    4332           <computeroutput>--cpu</computeroutput> option (defaulting to 0).
    4333           </para>
    4334         </listitem>
    4335 
    4336         <listitem>
    4337           <para>The <computeroutput>setregisters</computeroutput> command is
    4338           used to change CPU and device registers.  The command takes a list
    4339           of register assignments, each having one of the following forms:
    4340           <itemizedlist>
    4341             <listitem><para><computeroutput>register-set.register-name.sub-field=value</computeroutput></para></listitem>
    4342             <listitem><para><computeroutput>register-set.register-name=value</computeroutput></para></listitem>
    4343             <listitem><para><computeroutput>cpu-register-name.sub-field=value</computeroutput></para></listitem>
    4344             <listitem><para><computeroutput>cpu-register-name=value</computeroutput></para></listitem>
    4345           </itemizedlist>
    4346           The value format should be in the same style as what
    4347           <computeroutput>getregisters</computeroutput> displays, with the
    4348           exception that both octal and decimal can be used instead of
    4349           hexadecimal.  The register naming and the default CPU register set
    4350           are handled the same way as with the
    4351           <computeroutput>getregisters</computeroutput> command.</para>
    4352         </listitem>
    4353 
    4354         <listitem>
    4355           <para>The <computeroutput>statistics</computeroutput> command can be
    4356           used to display VMM statistics on the command line. The
    4357           <computeroutput>--reset</computeroutput> option will reset
    4358           statistics. The affected statistics can be filtered with the
    4359           <computeroutput>--pattern</computeroutput> option, which accepts
    4360           DOS/NT-style wildcards (<computeroutput>?</computeroutput> and
    4361           <computeroutput>*</computeroutput>).</para>
    4362         </listitem>
    4363       </itemizedlist></para>
    4364   </sect1>
    4365 
    43664256  <sect1 id="metrics">
    43674257    <title>VBoxManage metrics</title>
     
    46324522  </sect1>
    46334523
     4524  <xi:include href="man_VBoxManage_debugvm.xml" xpointer="element(/1)"
     4525    xmlns:xi="http://www.w3.org/2001/XInclude" />
     4526
    46344527  <xi:include href="man_VBoxManage_extpack.xml" xpointer="element(/1)"
    46354528    xmlns:xi="http://www.w3.org/2001/XInclude" />
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManage.cpp

    r56422 r56466  
    156156    { "extpack",            USAGE_EXTPACK,       HELP_CMD_EXTPACK, handleExtPack,              0 },
    157157    { "bandwidthctl",       USAGE_BANDWIDTHCONTROL, VBMG_CMD_TODO, handleBandwidthControl,     0 },
    158     { "debugvm",            USAGE_DEBUGVM,          VBMG_CMD_TODO, handleDebugVM,              0 },
     158    { "debugvm",            USAGE_DEBUGVM,       HELP_CMD_DEBUGVM, handleDebugVM,              0 },
    159159    { "convertfromraw",     USAGE_CONVERTFROMRAW,   VBMG_CMD_TODO, handleConvertFromRaw,       VBMG_CMD_F_NO_COM },
    160160    { "convertdd",          USAGE_CONVERTFROMRAW,   VBMG_CMD_TODO, handleConvertFromRaw,       VBMG_CMD_F_NO_COM },
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageDebugVM.cpp

    r56119 r56466  
    106106
    107107            default:
    108                 return errorGetOpt(USAGE_DEBUGVM, rc, &ValueUnion);
     108                return errorGetOpt(rc, &ValueUnion);
    109109        }
    110110    }
    111111
    112112    if (!cRegisters)
    113         return errorSyntax(USAGE_DEBUGVM, "The getregisters sub-command takes at least one register name");
     113        return errorSyntax("The getregisters sub-command takes at least one register name");
    114114    return RTEXITCODE_SUCCESS;
    115115}
     
    119119 *
    120120 * @returns Suitable exit code.
    121  * @param   a                   The handler arguments.
    122  * @param   pDebugger           Pointer to the debugger interface.
    123  */
    124 static RTEXITCODE handleDebugVM_Info(HandlerArg *a, IMachineDebugger *pDebugger)
    125 {
    126     if (a->argc < 3 || a->argc > 4)
    127         return errorSyntax(USAGE_DEBUGVM, "The inject sub-command takes at one or two arguments");
    128 
    129     com::Bstr bstrName(a->argv[2]);
    130     com::Bstr bstrArgs(a->argv[3]);
     121 * @param   pArgs               The handler arguments.
     122 * @param   pDebugger           Pointer to the debugger interface.
     123 */
     124static RTEXITCODE handleDebugVM_Info(HandlerArg *pArgs, IMachineDebugger *pDebugger)
     125{
     126    /*
     127     * Parse arguments.
     128     */
     129    const char    *pszInfo = NULL;
     130    const char    *pszArgs = NULL;
     131    RTGETOPTSTATE  GetState;
     132    RTGETOPTUNION  ValueUnion;
     133    int rc = RTGetOptInit(&GetState, pArgs->argc, pArgs->argv, NULL, 0, 2, RTGETOPTINIT_FLAGS_OPTS_FIRST);
     134    AssertRCReturn(rc, RTEXITCODE_FAILURE);
     135
     136    while ((rc = RTGetOpt(&GetState, &ValueUnion)) != 0)
     137    {
     138        switch (rc)
     139        {
     140            case VINF_GETOPT_NOT_OPTION:
     141                if (!pszInfo)
     142                    pszInfo = ValueUnion.psz;
     143                else if (!pszArgs)
     144                    pszArgs = ValueUnion.psz;
     145                else
     146                    return errorTooManyParameters(&pArgs->argv[GetState.iNext - 1]);
     147                break;
     148            default:
     149                return errorGetOpt(rc, &ValueUnion);
     150        }
     151    }
     152
     153    if (!pszInfo)
     154        return errorSyntax("Must specify info item to display");
     155
     156    /*
     157     * Do the work.
     158     */
     159    com::Bstr bstrName(pszInfo);
     160    com::Bstr bstrArgs(pszArgs);
    131161    com::Bstr bstrInfo;
    132162    CHECK_ERROR2I_RET(pDebugger, Info(bstrName.raw(), bstrArgs.raw(), bstrInfo.asOutParam()), RTEXITCODE_FAILURE);
     
    145175{
    146176    if (a->argc != 2)
    147         return errorSyntax(USAGE_DEBUGVM, "The inject sub-command does not take any arguments");
     177        return errorTooManyParameters(&a->argv[1]);
    148178    CHECK_ERROR2I_RET(pDebugger, InjectNMI(), RTEXITCODE_FAILURE);
    149179    return RTEXITCODE_SUCCESS;
     
    263293            case 'c':
    264294                if (pszCompression)
    265                     return errorSyntax(USAGE_DEBUGVM, "The --compression option has already been given");
     295                    return errorSyntax("The --compression option has already been given");
    266296                pszCompression = ValueUnion.psz;
    267297                break;
    268298            case 'f':
    269299                if (pszFilename)
    270                     return errorSyntax(USAGE_DEBUGVM, "The --filename option has already been given");
     300                    return errorSyntax("The --filename option has already been given");
    271301                pszFilename = ValueUnion.psz;
    272302                break;
    273303            default:
    274                 return errorGetOpt(USAGE_DEBUGVM, rc, &ValueUnion);
     304                return errorGetOpt(rc, &ValueUnion);
    275305        }
    276306    }
    277307
    278308    if (!pszFilename)
    279         return errorSyntax(USAGE_DEBUGVM, "The --filename option is required");
     309        return errorSyntax("The --filename option is required");
    280310
    281311    /*
     
    303333{
    304334    if (a->argc != 2)
    305         return errorSyntax(USAGE_DEBUGVM, "The osdetect sub-command does not take any arguments");
     335        return errorTooManyParameters(&a->argv[1]);
    306336
    307337    com::Bstr bstrIgnore;
     
    325355{
    326356    if (a->argc != 2)
    327         return errorSyntax(USAGE_DEBUGVM, "The osinfo sub-command does not take any arguments");
     357        return errorTooManyParameters(&a->argv[1]);
    328358
    329359    com::Bstr bstrName;
     
    361391        {
    362392            case 'n': uMaxMessages = ValueUnion.u32; break;
    363             default: return errorGetOpt(USAGE_DEBUGVM, rc, &ValueUnion);
     393            default: return errorGetOpt(rc, &ValueUnion);
    364394        }
    365395
     
    410440                const char *pszEqual = strchr(ValueUnion.psz, '=');
    411441                if (!pszEqual)
    412                     return errorSyntax(USAGE_DEBUGVM, "setregisters expects input on the form 'register=value' got '%s'", ValueUnion.psz);
     442                    return errorSyntax("setregisters expects input on the form 'register=value' got '%s'", ValueUnion.psz);
    413443                try
    414444                {
     
    428458
    429459            default:
    430                 return errorGetOpt(USAGE_DEBUGVM, rc, &ValueUnion);
     460                return errorGetOpt(rc, &ValueUnion);
    431461        }
    432462    }
    433463
    434464    if (!aBstrNames.size())
    435         return errorSyntax(USAGE_DEBUGVM, "The setregisters sub-command takes at least one register name");
     465        return errorSyntax("The setregisters sub-command takes at least one register name");
    436466
    437467    /*
     
    590620                    rcExit = handleDebugVM_Show_LogRelSettings(pDebugger, fFlags);
    591621                else
    592                     rcExit = errorSyntax(USAGE_DEBUGVM, "The show sub-command has no idea what '%s' might be", ValueUnion.psz);
     622                    rcExit = errorSyntax("The show sub-command has no idea what '%s' might be", ValueUnion.psz);
    593623                if (rcExit != RTEXITCODE_SUCCESS)
    594624                    return rcExit;
     
    597627
    598628            default:
    599                 return errorGetOpt(USAGE_DEBUGVM, rc, &ValueUnion);
     629                return errorGetOpt(rc, &ValueUnion);
    600630        }
    601631    }
     
    640670            case 'p':
    641671                if (pszPattern)
    642                     return errorSyntax(USAGE_DEBUGVM, "Multiple --pattern options are not permitted");
     672                    return errorSyntax("Multiple --pattern options are not permitted");
    643673                pszPattern = ValueUnion.psz;
    644674                break;
     
    649679
    650680            default:
    651                 return errorGetOpt(USAGE_DEBUGVM, rc, &ValueUnion);
     681                return errorGetOpt(rc, &ValueUnion);
    652682        }
    653683    }
    654684
    655685    if (fReset && fWithDescriptions)
    656         return errorSyntax(USAGE_DEBUGVM, "The --reset and --descriptions options does not mix");
     686        return errorSyntax("The --reset and --descriptions options does not mix");
    657687
    658688    /*
     
    685715     */
    686716    if (pArgs->argc < 2)
    687         return errorSyntax(USAGE_DEBUGVM, "Too few parameters");
     717        return errorNoSubcommand();
    688718    ComPtr<IMachine> ptrMachine;
    689719    CHECK_ERROR2I_RET(pArgs->virtualBox, FindMachine(com::Bstr(pArgs->argv[0]).raw(), ptrMachine.asOutParam()), RTEXITCODE_FAILURE);
     
    708738                 */
    709739                const char *pszSubCmd = pArgs->argv[1];
    710                 if (!strcmp(pszSubCmd, "dumpguestcore"))
     740                if (!strcmp(pszSubCmd, "dumpvmcore"))
     741                {
     742                    setCurrentSubcommand(HELP_SCOPE_DEBUGVM_DUMPVMCORE);
    711743                    rcExit = handleDebugVM_DumpVMCore(pArgs, ptrDebugger);
     744                }
    712745                else if (!strcmp(pszSubCmd, "getregisters"))
     746                {
     747                    setCurrentSubcommand(HELP_SCOPE_DEBUGVM_GETREGISTERS);
    713748                    rcExit = handleDebugVM_GetRegisters(pArgs, ptrDebugger);
     749                }
    714750                else if (!strcmp(pszSubCmd, "info"))
     751                {
     752                    setCurrentSubcommand(HELP_SCOPE_DEBUGVM_INFO);
    715753                    rcExit = handleDebugVM_Info(pArgs, ptrDebugger);
     754                }
    716755                else if (!strcmp(pszSubCmd, "injectnmi"))
     756                {
     757                    setCurrentSubcommand(HELP_SCOPE_DEBUGVM_INJECTNMI);
    717758                    rcExit = handleDebugVM_InjectNMI(pArgs, ptrDebugger);
     759                }
    718760                else if (!strcmp(pszSubCmd, "log"))
     761                {
     762                    setCurrentSubcommand(HELP_SCOPE_DEBUGVM_LOG);
    719763                    rcExit = handleDebugVM_LogXXXX(pArgs, ptrDebugger, pszSubCmd);
     764                }
    720765                else if (!strcmp(pszSubCmd, "logdest"))
     766                {
     767                    setCurrentSubcommand(HELP_SCOPE_DEBUGVM_LOGDEST);
    721768                    rcExit = handleDebugVM_LogXXXX(pArgs, ptrDebugger, pszSubCmd);
     769                }
    722770                else if (!strcmp(pszSubCmd, "logflags"))
     771                {
     772                    setCurrentSubcommand(HELP_SCOPE_DEBUGVM_LOGFLAGS);
    723773                    rcExit = handleDebugVM_LogXXXX(pArgs, ptrDebugger, pszSubCmd);
     774                }
    724775                else if (!strcmp(pszSubCmd, "osdetect"))
     776                {
     777                    setCurrentSubcommand(HELP_SCOPE_DEBUGVM_OSDETECT);
    725778                    rcExit = handleDebugVM_OSDetect(pArgs, ptrDebugger);
     779                }
    726780                else if (!strcmp(pszSubCmd, "osinfo"))
     781                {
     782                    setCurrentSubcommand(HELP_SCOPE_DEBUGVM_OSINFO);
    727783                    rcExit = handleDebugVM_OSInfo(pArgs, ptrDebugger);
     784                }
    728785                else if (!strcmp(pszSubCmd, "osdmesg"))
     786                {
     787                    setCurrentSubcommand(HELP_SCOPE_DEBUGVM_OSDMESG);
    729788                    rcExit = handleDebugVM_OSDmesg(pArgs, ptrDebugger);
     789                }
    730790                else if (!strcmp(pszSubCmd, "setregisters"))
     791                {
     792                    setCurrentSubcommand(HELP_SCOPE_DEBUGVM_SETREGISTERS);
    731793                    rcExit = handleDebugVM_SetRegisters(pArgs, ptrDebugger);
     794                }
    732795                else if (!strcmp(pszSubCmd, "show"))
     796                {
     797                    setCurrentSubcommand(HELP_SCOPE_DEBUGVM_SHOW);
    733798                    rcExit = handleDebugVM_Show(pArgs, ptrDebugger);
     799                }
    734800                else if (!strcmp(pszSubCmd, "statistics"))
     801                {
     802                    setCurrentSubcommand(HELP_SCOPE_DEBUGVM_STATISTICS);
    735803                    rcExit = handleDebugVM_Statistics(pArgs, ptrDebugger);
     804                }
    736805                else
    737                     errorSyntax(USAGE_DEBUGVM, "Invalid parameter '%s'", pArgs->argv[1]);
     806                    errorUnknownSubcommand(pszSubCmd);
    738807            }
    739808        }
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageHelp.cpp

    r56366 r56466  
    399399                return RTEXITCODE_SUCCESS;
    400400            }
     401            else if (!strcmp(papszArgs[i], "--"))
     402                break;
    401403
    402404    return errorSyntax("Too many parameters");
     
    13261328                     "                            --ip<ipv4> [--netmask<ipv4> (def: 255.255.255.0)] |\n"
    13271329                     "                            --ipv6<ipv6> [--netmasklengthv6<length> (def: 64)]]\n"
    1328 # if !defined(RT_OS_SOLARIS)
     1330# if !defined(RT_OS_SOLARIS) || defined(VBOX_ONLY_DOCS)
    13291331                     "                            create |\n"
    13301332                     "                            remove <name>\n"
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette