Index: /trunk/doc/manual/Makefile.kmk
===================================================================
--- /trunk/doc/manual/Makefile.kmk	(revision 56532)
+++ /trunk/doc/manual/Makefile.kmk	(revision 56533)
@@ -101,9 +101,11 @@
 # xsltproc with the catalog trick if applicable.
 ifdef VBOX_XML_CATALOG
- VBOX_XSLTPROC_WITH_CAT    = $(REDIRECT) -E "XML_CATALOG_FILES=$(VBOX_XML_CATALOG)" -- $(VBOX_XSLTPROC)
- VBOX_XMLLINT_WITH_CAT     = $(REDIRECT) -E "XML_CATALOG_FILES=$(VBOX_XML_CATALOG)" -- $(VBOX_XMLLINT)
+ VBOX_XSLTPROC_WITH_CAT    = $(REDIRECT) -E "XML_CATALOG_FILES=$(VBOX_XML_CATALOG)" -- \
+ 	$(VBOX_XSLTPROC) --nonet --xinclude $(VBOX_XSLTPROC_OPTS)
+ VBOX_XMLLINT_WITH_CAT     = $(REDIRECT) -E "XML_CATALOG_FILES=$(VBOX_XML_CATALOG)" -- \
+	$(VBOX_XMLLINT) --nonet --xinclude --noout $(VBOX_XMLLINT_OPTS)
 else
- VBOX_XSLTPROC_WITH_CAT    = $(VBOX_XSLTPROC)
- VBOX_XMLLINT_WITH_CAT     = $(VBOX_XMLLINT)
+ VBOX_XSLTPROC_WITH_CAT    = $(VBOX_XSLTPROC) --nonet --xinclude $(VBOX_XSLTPROC_OPTS)
+ VBOX_XMLLINT_WITH_CAT     = $(VBOX_XMLLINT) --nonet --xinclude --noout $(VBOX_XMLLINT_OPTS)
 endif
 
@@ -165,6 +167,6 @@
 ## List of refentry files (manpages).
 VBOX_MANUAL_XML_REFENTRY_FILES = \
-	man_VBoxManage_debugvm.xml \
-	man_VBoxManage_extpack.xml
+	man_VBoxManage-debugvm.xml \
+	man_VBoxManage-extpack.xml
 
 
@@ -283,4 +285,6 @@
  		$(VBOX_MANUAL_XML_FILES_INCL_CHANGELOG) \
                $(VBOX_MANUAL_XML_REFENTRY_FILES) \
+               $(addprefix user_,$(VBOX_MANUAL_XML_REFENTRY_FILES)) \
+               $(patsubst man_%,%.1,$(basename $(VBOX_MANUAL_XML_REFENTRY_FILES))) \
  		$(VBOX_MANUAL_LATEX_FILES_TARGET) \
 		$(VBOX_MANUAL_PNG_FILES_$(lang)) \
@@ -466,5 +470,5 @@
 $(foreach lang,$(VBOX_MANUAL_LANGUAGES), \
 $(eval $$(VBOX_PATH_MANUAL_OUTBASE)/$(lang)/user_VBoxManage.xml: $(VBOX_PATH_MANUAL_SRC)/$(lang)/user_VBoxManage.xml \
-	$$(addprefix $$(VBOX_PATH_MANUAL_OUTBASE)/$(lang)/,$$(filter man_VBoxManage%,$$(VBOX_MANUAL_XML_REFENTRY_FILES))) \
+	$$(addprefix $$(VBOX_PATH_MANUAL_OUTBASE)/$(lang)/user_,$$(filter man_VBoxManage%,$$(VBOX_MANUAL_XML_REFENTRY_FILES))) \
 	$$(addprefix $$(VBOX_PATH_MANUAL_OUTBASE)/overview_,$$(filter man_VBoxManage%,$$(VBOX_MANUAL_XML_REFENTRY_FILES))) \
 	$(VBOX_PATH_MANUAL_OUTBASE)/user_VBoxManage_CommandsOverview.xml ))
@@ -474,5 +478,5 @@
 		$(VBOX_PATH_MANUAL_OUTBASE)/% : \
 		$(VBOX_PATH_MANUAL_SRC)/% \
-               $$(addprefix $$(@D)/,$$(filter man_VBoxManage%,$$(VBOX_MANUAL_XML_REFENTRY_FILES))) \
+               $$(addprefix $$(@D)/user_,$$(filter man_VBoxManage%,$$(VBOX_MANUAL_XML_REFENTRY_FILES))) \
                $$(addprefix $$(@D)/overview_,$$(filter man_VBoxManage%,$$(VBOX_MANUAL_XML_REFENTRY_FILES))) \
 		$(VBOX_PATH_MANUAL_OUTBASE)/user_VBoxManage_CommandsOverview.xml \
@@ -510,15 +514,21 @@
 	$(QUIET)$(RM) -f $@.dumpopts $@.screen
 
-
+##
 # Morph man pages into manual sections.
-$(foreach lang,$(VBOX_MANUAL_LANGUAGES),$(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/$(lang)/,$(VBOX_MANUAL_XML_REFENTRY_FILES))): \
-		$(VBOX_PATH_MANUAL_OUTBASE)/% : $(VBOX_PATH_MANUAL_SRC)/% \
-		$(VBOX_PATH_MANUAL_SRC)/docbook-refentry-to-manual-sect1.xsl \
-		$(VBOX_XML_CATALOG) $(VBOX_XML_CATALOG_DOCBOOK) \
-		$(VBOX_VERSION_STAMP) | $$(dir $$@)
-	$(call MSG_GENERATE,,$@,$<)
-	$(QUIET)$(RM) -f $@
-	$(QUIET)$(VBOX_XSLTPROC_WITH_CAT) --xinclude --nonet --output $@ \
-		$(VBOX_PATH_MANUAL_SRC)/docbook-refentry-to-manual-sect1.xsl $<
+# $(evalcall2 def_vbox_refentry_to_user_sect1)
+# @param    1   The XSLT source file (relative to Makefile dir).
+# @param    2   Optional output subdirectory.
+define def_vbox_refentry_to_user_sect1
+$$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/user_$(2): \
+		$$(VBOX_PATH_MANUAL_SRC)/$(1)/$(2) \
+		$$(VBOX_PATH_MANUAL_SRC)/docbook-refentry-to-manual-sect1.xsl \
+		$$(VBOX_XML_CATALOG) $(VBOX_XML_CATALOG_DOCBOOK) \
+		$$(VBOX_VERSION_STAMP) | $$(dir $$@)
+	$$(call MSG_GENERATE,,$$@,$$<)
+	$$(QUIET)$$(RM) -f "$$@"
+	$$(QUIET)$$(VBOX_XSLTPROC_WITH_CAT) --output $$@ $$(VBOX_PATH_MANUAL_SRC)/docbook-refentry-to-manual-sect1.xsl $$<
+endef
+$(foreach lang,$(VBOX_MANUAL_LANGUAGES),$(foreach file,$(VBOX_MANUAL_XML_REFENTRY_FILES) \
+, $(evalcall2 def_vbox_refentry_to_user_sect1,$(lang),$(file))))
 
 
@@ -537,5 +547,5 @@
                | $$(dir $$@)
 	$(call MSG_GENERATE,,$@,$(filter %.xml,$^))
-	$(QUIET)$(VBOX_XSLTPROC_WITH_CAT) --xinclude --nonet --output "$@" $< $(filter %.xml,$^)
+	$(QUIET)$(VBOX_XSLTPROC_WITH_CAT) --output "$@" $< $(filter %.xml,$^)
 
 $(VBOX_PATH_MANUAL_OUTBASE)/user_VBoxManage_CommandsOverview.xml: $(MAKEFILE_CURRENT) | $$(dir $$@)
@@ -653,5 +663,5 @@
 #   pass current language to xsltproc in TARGETLANG variable (extract it from the
 #   current directory, should become "de_DE" or the like)
-	$(QUIET)$(VBOX_XSLTPROC_WITH_CAT) $(XSLTPROC_VERBOSE) --xinclude --nonet --stringparam TARGETLANG $(notdir $(@D)) \
+	$(QUIET)$(VBOX_XSLTPROC_WITH_CAT) --stringparam TARGETLANG $(notdir $(@D)) \
 		-o $@.tmp $(VBOX_PATH_MANUAL_SRC)/docbook2latex.xsl $<
 #   for pretty quotes, replace " with `` or '' depending on whether it's at the start of a word;
@@ -682,6 +692,5 @@
 		$$(VBOX_XML_CATALOG) $$(VBOX_XML_CATALOG_DOCBOOK) $$(MAKEFILE_CURRENT) | $$$$(dir $$$$@)
 	$$(call MSG_L1,Validating $$<)
-	$$(QUIET)$$(VBOX_XMLLINT_WITH_CAT) $$(VBOX_XMLLINT_OPTS) --dtdvalid $$(VBOX_PATH_DOCBOOK_DTD)/docbookx.dtd \
-		--xinclude --noout $$<
+	$$(QUIET)$$(VBOX_XMLLINT_WITH_CAT) --dtdvalid $$(VBOX_PATH_DOCBOOK_DTD)/docbookx.dtd $$<
 	$$(QUIET)$$(APPEND) -t "$$@" "done"
 endef
@@ -718,5 +727,5 @@
 	$(QUIET)$(RM) -f $(addprefix $(@D/),$(VBOX_SDKREF_LATEX_FILES_TARGET))
 #	generate TeX source from processed docbook and store it in SDKRef.tex.tmp
-	$(QUIET)$(VBOX_XSLTPROC_WITH_CAT) $(XSLTPROC_VERBOSE) --xinclude --nonet --stringparam TARGETLANG en_US \
+	$(QUIET)$(VBOX_XSLTPROC_WITH_CAT) --stringparam TARGETLANG en_US \
 		-o $@.tmp $(VBOX_PATH_MANUAL_SRC)/docbook2latex.xsl $<
 #	for pretty quotes, replace " with `` or '' depending on whether it's at the start of a word;
@@ -734,6 +743,5 @@
 		$(VBOX_XML_CATALOG) $(VBOX_XML_CATALOG_DOCBOOK) $(MAKEFILE_CURRENT)
 	$(call MSG_L1,Validating $(filter %.xml,$^))
-	$(QUIET)$(VBOX_XMLLINT_WITH_CAT) $(VBOX_XMLLINT_OPTS) --dtdvalid $(VBOX_PATH_DOCBOOK_DTD)/docbookx.dtd \
-		--xinclude --noout $(filter %.xml,$^)
+	$(QUIET)$(VBOX_XMLLINT_WITH_CAT) --dtdvalid $(VBOX_PATH_DOCBOOK_DTD)/docbookx.dtd  $(filter %.xml,$^)
 
 
@@ -799,5 +807,5 @@
 	$(QUIET)$(RM) -f $@
 	$(QUIET)$(MKDIR) -p $(@D)
-	$(QUIET)$(VBOX_XSLTPROC_WITH_CAT) --xinclude --nonet --output $(@D)/ \
+	$(QUIET)$(VBOX_XSLTPROC_WITH_CAT) --output $(@D)/ \
 		--stringparam htmlhelp.chm \
 		$(subst /,\\,$(@D)/../VirtualBox.chm) \
@@ -865,5 +873,5 @@
 		| $$(dir $$@)
 	$(call MSG_L1,xsltproc $<)
-	$(QUIET)$(VBOX_XSLTPROC_WITH_CAT) --xinclude --nonet $(XSLTPROC_VERBOSE) \
+	$(QUIET)$(VBOX_XSLTPROC_WITH_CAT) \
 		--output $(VBOX_PATH_MANUAL_OUTBASE)/en_US/html-single/UserManual.html \
 		$(VBOX_PATH_MANUAL_OUTBASE)/en_US/docbook-html-one-page-formatcfg.xsl \
@@ -878,5 +886,5 @@
 		| $$(dir $$@)
 	$(call MSG_L1,xsltproc $<)
-	$(QUIET)$(VBOX_XSLTPROC_WITH_CAT) --xinclude --nonet $(XSLTPROC_VERBOSE) \
+	$(QUIET)$(VBOX_XSLTPROC_WITH_CAT) \
 		--output $(VBOX_PATH_MANUAL_OUTBASE)/en_US/html-chunks/index.html \
 		--stringparam chunk.section.depth 0 \
@@ -935,25 +943,45 @@
 
 #
-# VBoxManage man pages.
-#
-$(evalcall2 def_vbox_replace_paths_in_xslt,docbook-refentry-to-man.xsl,)
-
-man-experiment: \
-		$(VBOX_PATH_MANUAL_SRC)/en_US/man_VBoxManage_extpack.xml \
-		$(VBOX_PATH_MANUAL_OUTBASE)/docbook-refentry-to-man.xsl \
-		$(VBOX_XML_CATALOG) $(VBOX_XML_CATALOG_DOCBOOK)
-	$(VBOX_XSLTPROC_WITH_CAT) --xinclude --nonet --output z:/tmp/vboxmanage-extpack.1 \
-		$(VBOX_PATH_MANUAL_OUTBASE)/docbook-refentry-to-man.xsl \
-		$(VBOX_PATH_MANUAL_SRC)/en_US/man_VBoxManage_extpack.xml
-
-$(evalcall2 def_vbox_replace_paths_in_xslt,docbook-refentry-to-C-help.xsl,)
-$(evalcall2 def_vbox_replace_paths_in_xslt,docbook-refentry-to-H-help.xsl,)
-
-# validate man page XML source
-validateman: $(addprefix $(VBOX_PATH_MANUAL_SRC)/en_US/,$(VBOX_MANUAL_XML_REFENTRY_FILES)) \
-		$(VBOX_XML_CATALOG) $(VBOX_XML_CATALOG_DOCBOOK) $(MAKEFILE_CURRENT)
-	$(call MSG_L1,Validating $(filter %.xml,$^))
-	$(QUIET)$(VBOX_XMLLINT_WITH_CAT) $(VBOX_XMLLINT_OPTS) --dtdvalid $(VBOX_PATH_DOCBOOK_DTD)/docbookx.dtd \
-		--noout $(filter %.xml,$^)
+# VBoxManage man pages (parts also required by VBoxManage build-in help).
+#
+$(evalcall2 def_vbox_replace_paths_in_xslt,docbook-refentry-to-manpage.xsl,)
+
+##
+# Emits rules for preprocessing refentry sources (applying remarks element),
+# and for producing the actual man pages.
+# $(evalcall2 def_vbox_refentry_to_manpage)
+# @param    1   The language
+# @param    2   The file name (no path).
+define def_vbox_refentry_to_manpage
+$$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/$(2): \
+		$$(VBOX_PATH_MANUAL_SRC)/$(1)/$(2) \
+		$$(VBOX_PATH_MANUAL_SRC)/docbook-refentry-to-manpage-preprocessing.xsl \
+		$$(VBOX_XML_CATALOG) $(VBOX_XML_CATALOG_DOCBOOK) \
+		$$(VBOX_VERSION_STAMP) | $$$$(dir $$$$@)
+	$$(call MSG_GENERATE,,$$@,$$<)
+	$$(QUIET)$$(RM) -f "$$@"
+	$$(QUIET)$$(VBOX_XSLTPROC_WITH_CAT) --output $$@ \
+		$$(VBOX_PATH_MANUAL_SRC)/docbook-refentry-to-manpage-preprocessing.xsl $$<
+ ifdef VBOX_WITH_XMLLINT
+	$$(QUIET)$$(VBOX_XMLLINT_WITH_CAT) --dtdvalid $$(VBOX_PATH_DOCBOOK_DTD)/docbookx.dtd $$@
+ endif
+
+$$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/$(patsubst man_%,%.1,$(basename $(2))): \
+		$$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/$(2) \
+		$$(VBOX_PATH_MANUAL_OUTBASE)/docbook-refentry-to-manpage.xsl \
+		$$(VBOX_XML_CATALOG) $(VBOX_XML_CATALOG_DOCBOOK) \
+		$$(VBOX_VERSION_STAMP) | $$$$(dir $$$$@)
+	$$(call MSG_GENERATE,,$$@,$$<)
+	$$(QUIET)$$(RM) -f "$$@"
+	$$(QUIET)$$(VBOX_XSLTPROC_WITH_CAT) --output $$@ $$(VBOX_PATH_MANUAL_OUTBASE)/docbook-refentry-to-manpage.xsl $$<
+endef
+$(foreach lang,$(VBOX_MANUAL_LANGUAGES),$(foreach file,$(VBOX_MANUAL_XML_REFENTRY_FILES) \
+, $(evalcall2 def_vbox_refentry_to_manpage,$(lang),$(file))))
+
+
+# Handy aliases.
+validate-manpages:: $(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/en_US/,$(VBOX_MANUAL_XML_REFENTRY_FILES))
+man-experiment:: $(foreach lang,$(VBOX_MANUAL_LANGUAGES),$(foreach file,$(VBOX_MANUAL_XML_REFENTRY_FILES) \
+			,$$(VBOX_PATH_MANUAL_OUTBASE)/$(lang)/$(patsubst man_%,%.1,$(basename $(file)))))
 
 
@@ -974,8 +1002,11 @@
 	$(VBOX_PATH_MANUAL_OUTBASE)/VBoxManageBuiltInHelp.h
 
+$(evalcall2 def_vbox_replace_paths_in_xslt,docbook-refentry-to-C-help.xsl,)
+$(evalcall2 def_vbox_replace_paths_in_xslt,docbook-refentry-to-H-help.xsl,)
+
 $(VBOX_PATH_MANUAL_OUTBASE)/VBoxManageBuiltInHelp.cpp: \
 		$(VBOX_PATH_MANUAL_OUTBASE)/docbook-refentry-to-C-help.xsl \
-		$(addprefix $(VBOX_PATH_MANUAL_SRC)/en_US/,$(filter man_VBoxManage_%,$(VBOX_MANUAL_XML_REFENTRY_FILES))) \
-		$(VBOX_XML_CATALOG) $(VBOX_XML_CATALOG_DOCBOOK) $(MAKEFILE)
+		$(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/en_US/,$(filter man_VBoxManage-%,$(VBOX_MANUAL_XML_REFENTRY_FILES))) \
+		$(VBOX_XML_CATALOG) $(VBOX_XML_CATALOG_DOCBOOK) $(MAKEFILE) | $$(dir $$@)
 	$(call MSG_GENERATE,,$@,$<)
 	$(QUIET)$(APPEND) -tn "$@" \
@@ -986,10 +1017,11 @@
 		''
 	$(foreach refentry,$(filter %.xml,$^) \
-	,$(NLTAB)$(QUIET)$(REDIRECT) -a+to "$@" -- $(VBOX_XSLTPROC_WITH_CAT) --xinclude --nonet $< $(refentry))
+	,$(NLTAB)$(QUIET)$(REDIRECT) -a+to "$@" -- $(VBOX_XSLTPROC_WITH_CAT) $< $(refentry))
 	$(QUIET)$(APPEND) -n "$@" \
        	'' \
 		'PCREFENTRY     g_apHelpEntries[] = ' \
 		'{' \
-               $(foreach refentry,$(filter %.xml,$^), '    &g_$(tolower $(patsubst man_%,%,$(notdir $(basename $(refentry))))), ') \
+               $(foreach refentry,$(filter %.xml,$^) \
+		, '    &g_$(subst -,_,$(tolower $(patsubst man_%,%,$(notdir $(basename $(refentry)))))), ') \
 		'};' \
 		'const uint32_t g_cHelpEntries = RT_ELEMENTS(g_apHelpEntries);' \
@@ -998,6 +1030,6 @@
 $(VBOX_PATH_MANUAL_OUTBASE)/VBoxManageBuiltInHelp.h: \
 		$(VBOX_PATH_MANUAL_OUTBASE)/docbook-refentry-to-H-help.xsl \
-		$(addprefix $(VBOX_PATH_MANUAL_SRC)/en_US/,$(filter man_VBoxManage_%,$(VBOX_MANUAL_XML_REFENTRY_FILES))) \
-		$(VBOX_XML_CATALOG) $(VBOX_XML_CATALOG_DOCBOOK) $(MAKEFILE)
+		$(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/en_US/,$(filter man_VBoxManage-%,$(VBOX_MANUAL_XML_REFENTRY_FILES))) \
+		$(VBOX_XML_CATALOG) $(VBOX_XML_CATALOG_DOCBOOK) $(MAKEFILE) | $$(dir $$@)
 	$(call MSG_GENERATE,,$@,$<)
 	$(QUIET)$(APPEND) -tn "$@" \
@@ -1015,5 +1047,5 @@
                '    HELP_CMD_VBOXMANAGE_INVALID = 0,'
 	$(foreach refentry,$(filter %.xml,$^) \
-	,$(NLTAB)$(QUIET)$(REDIRECT) -a+to "$@" -- $(VBOX_XSLTPROC_WITH_CAT) --xinclude --nonet \
+	,$(NLTAB)$(QUIET)$(REDIRECT) -a+to "$@" -- $(VBOX_XSLTPROC_WITH_CAT) \
 		--stringparam 'g_sMode' 'cmd' $< $(refentry))
 	$(QUIET)$(APPEND) -n "$@" \
@@ -1021,5 +1053,5 @@
 		'} HELP_CMD_VBOXMANAGE;'
 	$(foreach refentry,$(filter %.xml,$^) \
-	,$(NLTAB)$(QUIET)$(REDIRECT) -a+to "$@" -- $(VBOX_XSLTPROC_WITH_CAT) --xinclude --nonet \
+	,$(NLTAB)$(QUIET)$(REDIRECT) -a+to "$@" -- $(VBOX_XSLTPROC_WITH_CAT) \
 		--stringparam 'g_sMode' 'subcmd' $< $(refentry))
 	$(QUIET)$(APPEND) -n "$@" \
Index: /trunk/doc/manual/docbook-refentry-to-C-help.xsl
===================================================================
--- /trunk/doc/manual/docbook-refentry-to-C-help.xsl	(revision 56532)
+++ /trunk/doc/manual/docbook-refentry-to-C-help.xsl	(revision 56533)
@@ -165,5 +165,5 @@
     <xsl:if test="text()"><xsl:message terminate="yes">cmdsynopsis with text is not supported.</xsl:message></xsl:if>
     <xsl:text>
-    {   </xsl:text><xsl:call-template name="calc-scope-cmdsynopsis"/><xsl:text>,
+    {   </xsl:text><xsl:call-template name="calc-scope-cmdsynopsis"/><xsl:text> | REFENTRYSTR_FLAGS_SYNOPSIS,
         "</xsl:text><xsl:call-template name="emit-indentation"/><xsl:apply-templates select="*|@*"/><xsl:text>" },</xsl:text>
   </xsl:template>
@@ -171,6 +171,17 @@
   <xsl:template match="sbr">
     <xsl:text>" },
-    {   REFENTRYSTR_SCOPE_SAME,
-        "    </xsl:text><xsl:call-template name="emit-indentation"/>
+    {   REFENTRYSTR_SCOPE_SAME | REFENTRYSTR_FLAGS_SYNOPSIS,
+        "    </xsl:text><xsl:call-template name="emit-indentation"/> <!-- hardcoded in VBoxManageHelp.cpp too -->
+  </xsl:template>
+
+  <xsl:template match="cmdsynopsis/command">
+    <xsl:text>" },
+    {   REFENTRYSTR_SCOPE_SAME | REFENTRYSTR_FLAGS_SYNOPSIS,
+        "</xsl:text><xsl:call-template name="emit-indentation"/>
+    <xsl:apply-templates select="node()|@*"/>
+  </xsl:template>
+
+  <xsl:template match="cmdsynopsis/command[1]" priority="2">
+    <xsl:apply-templates select="node()|@*"/>
   </xsl:template>
 
@@ -234,16 +245,5 @@
     <!-- Format the text in the section -->
     <xsl:for-each select="./*[name() != 'title']">
-      <xsl:choose>
-        <xsl:when test="self::remark[@scope = 'help-copy-synopsis']">
-          <xsl:variable name="sSrcId" select="concat('synopsis-', @condition)"/>
-          <xsl:if test="not(/refentry/refsynopsisdiv/cmdsynopsis[@id = $sSrcId])">
-            <xsl:message terminate="yes">Could not find any cmdsynopsis with id=<xsl:value-of select="$sSrcId"/> in refsynopsisdiv.</xsl:message>
-          </xsl:if>
-          <xsl:apply-templates select="/refentry/refsynopsisdiv/cmdsynopsis[@id = $sSrcId]"/>
-        </xsl:when>
-        <xsl:otherwise>
-          <xsl:apply-templates select="."/>
-        </xsl:otherwise>
-      </xsl:choose>
+      <xsl:apply-templates select="."/>
     </xsl:for-each>
 
@@ -447,14 +447,8 @@
 
   <!--
-    Fail on misplaced scoping remarks.
+    Execute synopsis copy remark (avoids duplication for complicated xml).
     -->
   <xsl:template match="remark[@role = 'help-copy-synopsis']">
-    <xsl:choose>
-      <xsl:when test="parent::refsect2"/>
-      <xsl:otherwise>
-        <xsl:message terminate="yes">Misplaced remark/@role=help-copy-synopsis element.
-Only supported on: refsect2</xsl:message>
-      </xsl:otherwise>
-    </xsl:choose>
+    <xsl:message terminate="yes">remark/@role=help-copy-synopsis is not supported by this stylesheet. Must preprocess input!</xsl:message>
   </xsl:template>
 
Index: unk/doc/manual/docbook-refentry-to-man.xsl
===================================================================
--- /trunk/doc/manual/docbook-refentry-to-man.xsl	(revision 56532)
+++ 	(revision )
@@ -1,31 +1,0 @@
-<?xml version="1.0"?>
-<!--
-    docbook-to-man.xsl:
-        XSLT stylesheet that renders a refentry into a troff manpage.
-
-    Copyright (C) 2006-2015 Oracle Corporation
-
-    This file is part of VirtualBox Open Source Edition (OSE), as
-    available from http://www.virtualbox.org. This file is free software;
-    you can redistribute it and/or modify it under the terms of the GNU
-    General Public License (GPL) as published by the Free Software
-    Foundation, in version 2 as it comes in the "COPYING" file of the
-    VirtualBox OSE distribution. VirtualBox OSE is distributed in the
-    hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
--->
-
-<xsl:stylesheet
-  version="1.0"
-  xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
-
-  <xsl:import href="@VBOX_PATH_DOCBOOK@/manpages/docbook.xsl"/>
-<!--  <xsl:import href="@VBOX_PATH_MANUAL_SRC@/common-formatcfg.xsl"/> -->
-
-  <!--
-  <xsl:output method="xml" version="1.0" encoding="utf-8" indent="yes"/>
-  <xsl:strip-space elements="*"/>
-  -->
-
-
-</xsl:stylesheet>
-
Index: /trunk/doc/manual/docbook-refentry-to-manpage.xsl
===================================================================
--- /trunk/doc/manual/docbook-refentry-to-manpage.xsl	(revision 56533)
+++ /trunk/doc/manual/docbook-refentry-to-manpage.xsl	(revision 56533)
@@ -0,0 +1,31 @@
+<?xml version="1.0"?>
+<!--
+    docbook-to-man.xsl:
+        XSLT stylesheet that renders a refentry into a troff manpage.
+
+    Copyright (C) 2006-2015 Oracle Corporation
+
+    This file is part of VirtualBox Open Source Edition (OSE), as
+    available from http://www.virtualbox.org. This file is free software;
+    you can redistribute it and/or modify it under the terms of the GNU
+    General Public License (GPL) as published by the Free Software
+    Foundation, in version 2 as it comes in the "COPYING" file of the
+    VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+    hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+-->
+
+<xsl:stylesheet
+  version="1.0"
+  xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+  <xsl:import href="@VBOX_PATH_DOCBOOK@/manpages/docbook.xsl"/>
+<!--  <xsl:import href="@VBOX_PATH_MANUAL_SRC@/common-formatcfg.xsl"/> -->
+
+  <!--
+  <xsl:output method="xml" version="1.0" encoding="utf-8" indent="yes"/>
+  <xsl:strip-space elements="*"/>
+  -->
+
+
+</xsl:stylesheet>
+
Index: /trunk/doc/manual/en_US/man_VBoxManage-debugvm.xml
===================================================================
--- /trunk/doc/manual/en_US/man_VBoxManage-debugvm.xml	(revision 56533)
+++ /trunk/doc/manual/en_US/man_VBoxManage-debugvm.xml	(revision 56533)
@@ -0,0 +1,358 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    manpage, user manual, usage: VBoxManage debugvm
+
+    Copyright (C) 2006-2015 Oracle Corporation
+
+    This file is part of VirtualBox Open Source Edition (OSE), as
+    available from http://www.virtualbox.org. This file is free software;
+    you can redistribute it and/or modify it under the terms of the GNU
+    General Public License (GPL) as published by the Free Software
+    Foundation, in version 2 as it comes in the "COPYING" file of the
+    VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+    hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ -->
+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
+<refentry id="vboxmanage-debugvm" lang="en">
+
+  <refentryinfo>
+    <pubdate>$Date$</pubdate>
+    <title>VBoxManage debugvm</title>
+  </refentryinfo>
+
+  <refmeta>
+    <refentrytitle>VBoxManage-debugvm</refentrytitle>
+    <manvolnum>1</manvolnum>
+  </refmeta>
+
+  <refnamediv>
+    <refname>VBoxManage-debugvm</refname>
+    <refpurpose>introspection and guest debugging</refpurpose>
+    <refclass>Oracle VM VirtualBox</refclass>
+  </refnamediv>
+
+  <refsynopsisdiv>
+    <cmdsynopsis id="synopsis-vboxmanage-debugvm-dumpvmcore">
+      <command>VBoxManage debugvm</command>
+      <arg choice="req"><replaceable>uuid|vmname</replaceable></arg>
+      <arg choice="plain">dumpvmcore</arg>
+      <arg>--filename <replaceable>name</replaceable></arg>
+    </cmdsynopsis>
+    <cmdsynopsis id="synopsis-vboxmanage-debugvm-info">
+      <command>VBoxManage debugvm</command>
+      <arg choice="req"><replaceable>uuid|vmname</replaceable></arg>
+      <arg choice="plain">info</arg>
+      <arg choice="req"><replaceable>item</replaceable></arg>
+      <arg rep="repeat"><replaceable>args</replaceable></arg>
+    </cmdsynopsis>
+    <cmdsynopsis id="synopsis-vboxmanage-debugvm-injectnmi">
+      <command>VBoxManage debugvm</command>
+      <arg choice="req"><replaceable>uuid|vmname</replaceable></arg>
+      <arg choice="plain">injectnmi</arg>
+    </cmdsynopsis>
+    <cmdsynopsis id="synopsis-vboxmanage-debugvm-log">
+      <command>VBoxManage debugvm</command>
+      <arg choice="req"><replaceable>uuid|vmname</replaceable></arg>
+      <arg choice="plain">log</arg>
+      <group><arg>--release</arg><arg>--debug</arg></group>
+      <arg rep="repeat"><replaceable>group-settings</replaceable></arg>
+    </cmdsynopsis>
+    <cmdsynopsis id="synopsis-vboxmanage-debugvm-logdest">
+      <command>VBoxManage debugvm</command>
+      <arg choice="req"><replaceable>uuid|vmname</replaceable></arg>
+      <arg choice="plain">logdest</arg>
+      <group><arg>--release</arg><arg>--debug</arg></group>
+      <arg rep="repeat"><replaceable>destinations</replaceable></arg>
+    </cmdsynopsis>
+    <cmdsynopsis id="synopsis-vboxmanage-debugvm-logflags">
+      <command>VBoxManage debugvm</command>
+      <arg choice="req"><replaceable>uuid|vmname</replaceable></arg>
+      <arg choice="plain">logflags</arg>
+      <group><arg>--release</arg><arg>--debug</arg></group>
+      <arg rep="repeat"><replaceable>flags</replaceable></arg>
+    </cmdsynopsis>
+    <cmdsynopsis id="synopsis-vboxmanage-debugvm-osdetect">
+      <command>VBoxManage debugvm</command>
+      <arg choice="req"><replaceable>uuid|vmname</replaceable></arg>
+      <arg choice="plain">osdetect</arg>
+    </cmdsynopsis>
+    <cmdsynopsis id="synopsis-vboxmanage-debugvm-osinfo">
+      <command>VBoxManage debugvm</command>
+      <arg choice="req"><replaceable>uuid|vmname</replaceable></arg>
+      <arg choice="plain">osinfo</arg>
+    </cmdsynopsis>
+    <cmdsynopsis id="synopsis-vboxmanage-debugvm-osdmesg">
+      <command>VBoxManage debugvm</command>
+      <arg choice="req"><replaceable>uuid|vmname</replaceable></arg>
+      <arg choice="plain">osdmesg</arg>
+      <arg>--lines <replaceable>lines</replaceable></arg>
+    </cmdsynopsis>
+    <cmdsynopsis id="synopsis-vboxmanage-debugvm-getregisters">
+      <command>VBoxManage debugvm</command>
+      <arg choice="req"><replaceable>uuid|vmname</replaceable></arg>
+      <arg choice="plain">getregisters</arg>
+      <arg>--cpu <replaceable>id</replaceable></arg>
+      <arg rep="repeat"><replaceable>reg-set.reg-name</replaceable></arg>
+    </cmdsynopsis>
+    <cmdsynopsis id="synopsis-vboxmanage-debugvm-setregisters">
+      <command>VBoxManage debugvm</command>
+      <arg choice="req"><replaceable>uuid|vmname</replaceable></arg>
+      <arg choice="plain">setregisters</arg>
+      <arg>--cpu <replaceable>id</replaceable></arg>
+      <arg rep="repeat"><replaceable>reg-set.reg-name=value</replaceable></arg>
+    </cmdsynopsis>
+    <cmdsynopsis id="synopsis-vboxmanage-debugvm-show">
+      <command>VBoxManage debugvm</command>
+      <arg choice="req"><replaceable>uuid|vmname</replaceable></arg>
+      <arg choice="plain">show</arg>
+      <group><arg>--human-readable</arg><arg>--sh-export</arg><arg>--sh-eval</arg><arg>--cmd-set</arg></group>
+      <arg rep="repeat"><replaceable>settings-item</replaceable></arg>
+    </cmdsynopsis>
+    <cmdsynopsis id="synopsis-vboxmanage-debugvm-statistics">
+      <command>VBoxManage debugvm</command>
+      <arg choice="req"><replaceable>uuid|vmname</replaceable></arg>
+      <arg choice="plain">statistics</arg>
+      <arg>--reset</arg>
+      <arg>--descriptions</arg>
+      <arg>--pattern <replaceable>pattern</replaceable></arg>
+    </cmdsynopsis>
+  </refsynopsisdiv>
+  <refsect1>
+    <title>Description</title>
+
+    <para>The "debugvm" commands are for experts who want to tinker with the
+      exact details of virtual machine execution.  Like the VM debugger<remark role="help-manual">
+      described in <xref linkend="ts_debugger" /></remark>, these commands are only useful if you are
+      very familiar with the details of the PC architecture and how to debug
+      software.</para>
+
+    <refsect2 id="vboxmanage-debugvm-common-options">
+      <title>Common options</title>
+      <remark role="help-scope" condition="GLOBAL"/>
+      <para>The subcommands of <command>debugvm</command> all operate on a running virtual
+      machine:</para>
+      <variablelist>
+        <varlistentry>
+          <term><replaceable>uuid|vmname</replaceable></term>
+          <listitem><para>Either the UUID or the name (case sensitive) of a VM.</para></listitem>
+        </varlistentry>
+      </variablelist>
+    </refsect2>
+
+    <refsect2 id="vboxmanage-debugvm-dumpvmcore">
+      <title>debugvm dumpvmcore</title>
+      <remark role="help-copy-synopsis"/>
+      <para>
+        Creates a system dump file of the specified VM.  This file will have
+        the standard ELF core format (with custom sections)<remark role="help-manual">; see
+        <xref linkend="ts_guest-core-format" /></remark>.
+      </para>
+      <para>
+        This corresponds to the <command>writecore</command> command in the debugger.
+      </para>
+      <variablelist>
+        <varlistentry>
+          <term><option>--filename <replaceable>filename</replaceable></option></term>
+          <listitem><para>The name of the output file.</para></listitem>
+        </varlistentry>
+      </variablelist>
+    </refsect2>
+
+    <refsect2 id="vboxmanage-debugvm-info">
+      <title>debugvm info</title>
+      <remark role="help-copy-synopsis"/>
+      <para>
+        Displays info items relating to the VMM, device emulations and
+        associated drivers.
+      </para>
+      <para>
+        This corresponds to the <command>info</command> command in the debugger.
+      </para>
+      <variablelist>
+        <varlistentry>
+          <term><replaceable>info</replaceable></term>
+          <listitem>
+            <para>Name of the info item to display.  The special name
+            <option>help</option> will list all the available info items and
+            hints about optional arguments.</para>
+          </listitem>
+        </varlistentry>
+        <varlistentry>
+          <term><replaceable>args</replaceable></term>
+          <listitem>
+            <para>Optional argument string for the info item handler.  Most info items
+            does not take any extra arguments.  Arguments not recognized are generally
+            ignored.</para>
+          </listitem>
+        </varlistentry>
+      </variablelist>
+    </refsect2>
+
+    <refsect2 id="vboxmanage-debugvm-injectnmi">
+      <title>debugvm injectnmi</title>
+      <remark role="help-copy-synopsis"/>
+      <para>
+        Causes a non-maskable interrupt (NMI) to be injected into the guest. This
+        might be useful for certain debugging scenarios. What happens exactly is
+        dependent on the guest operating system, but an NMI can crash the whole
+        guest operating system. Do not use unless you know what you're doing.
+      </para>
+    </refsect2>
+
+    <refsect2 id="vboxmanage-debugvm-log">
+      <title>debugvm log</title>
+      <remark role="help-copy-synopsis"/>
+      <para>
+        TODO
+      </para>
+    </refsect2>
+
+    <refsect2 id="vboxmanage-debugvm-logdest">
+      <title>debugvm logdest</title>
+      <remark role="help-copy-synopsis"/>
+      <para>
+        TODO
+      </para>
+    </refsect2>
+
+    <refsect2 id="vboxmanage-debugvm-logflags">
+      <title>debugvm logflags</title>
+      <remark role="help-copy-synopsis"/>
+      <para>
+        TODO
+      </para>
+    </refsect2>
+
+    <refsect2 id="vboxmanage-debugvm-osdetect">
+      <title>debugvm osdetect</title>
+      <remark role="help-copy-synopsis"/>
+      <para>
+        Make the VMM's debugger facility (re)-detect the guest operating system (OS).
+        This will first load all debugger plug-ins.
+      </para>
+      <para>
+        This corresponds to the <command>detect</command> command in the debugger.
+      </para>
+    </refsect2>
+
+    <refsect2 id="vboxmanage-debugvm-osinfo">
+      <title>debugvm osinfo</title>
+      <remark role="help-copy-synopsis"/>
+      <para>
+        Displays information about the guest operating system (OS) previously
+        detected by the VMM's debugger facility.
+      </para>
+    </refsect2>
+
+    <refsect2 id="vboxmanage-debugvm-osdmesg">
+      <title>debugvm osdmesg</title>
+      <remark role="help-copy-synopsis"/>
+      <para>
+        Displays the guest OS kernel log, if detected and supported.
+      </para>
+      <variablelist>
+        <varlistentry>
+          <term><option>--lines <replaceable>lines</replaceable></option></term>
+          <listitem><para>Number of lines of the log to display, counting from
+          the end. The default is infinite.</para></listitem>
+        </varlistentry>
+      </variablelist>
+    </refsect2>
+
+    <refsect2 id="vboxmanage-debugvm-getregisters">
+      <title>debugvm getregisters</title>
+      <remark role="help-copy-synopsis"/>
+      <para>
+        Retrieves register values for guest CPUs and emulated devices.
+      </para>
+      <variablelist>
+        <varlistentry>
+          <term><replaceable>reg-set.reg-name</replaceable></term>
+          <listitem><para>One of more registers, each having one of the following forms:
+            <itemizedlist>
+              <listitem><para><computeroutput>register-set.register-name.sub-field</computeroutput></para></listitem>
+              <listitem><para><computeroutput>register-set.register-name</computeroutput></para></listitem>
+              <listitem><para><computeroutput>cpu-register-name.sub-field</computeroutput></para></listitem>
+              <listitem><para><computeroutput>cpu-register-name</computeroutput></para></listitem>
+              <listitem><para><computeroutput>all</computeroutput></para></listitem>
+            </itemizedlist>
+            The <replaceable>all</replaceable> form will cause all registers
+            to be shown (no sub-fields).  The registers names are case-insensitive.
+          </para></listitem>
+        </varlistentry>
+        <varlistentry>
+          <term><option>--cpu <replaceable>id</replaceable></option></term>
+          <listitem><para>Selects the CPU register set when specifying just a
+            CPU register (3rd and 4th form).  The default is 0.</para>
+          </listitem>
+        </varlistentry>
+      </variablelist>
+    </refsect2>
+
+    <refsect2 id="vboxmanage-debugvm-setregisters">
+      <title>debugvm setregisters</title>
+      <remark role="help-copy-synopsis"/>
+      <para>
+        Changes register values for guest CPUs and emulated devices.
+      </para>
+      <variablelist>
+        <varlistentry>
+          <term><replaceable>reg-set.reg-name=value</replaceable></term>
+          <listitem><para>One of more register assignment, each having one of the following forms:
+            <itemizedlist>
+              <listitem><para><computeroutput>register-set.register-name.sub-field=value</computeroutput></para></listitem>
+              <listitem><para><computeroutput>register-set.register-name=value</computeroutput></para></listitem>
+              <listitem><para><computeroutput>cpu-register-name.sub-field=value</computeroutput></para></listitem>
+              <listitem><para><computeroutput>cpu-register-name=value</computeroutput></para></listitem>
+            </itemizedlist>
+            The value format should be in the same style as what <command>getregisters</command>
+            displays, with the exception that both octal and decimal can be used instead of
+            hexadecimal.
+          </para></listitem>
+        </varlistentry>
+        <varlistentry>
+          <term><option>--cpu <replaceable>id</replaceable></option></term>
+          <listitem><para>Selects the CPU register set when specifying just a
+            CPU register (3rd and 4th form).  The default is 0.</para>
+          </listitem>
+        </varlistentry>
+      </variablelist>
+    </refsect2>
+
+    <refsect2 id="vboxmanage-debugvm-show">
+      <title>debugvm show</title>
+      <remark role="help-copy-synopsis"/>
+      <para>
+        TODO
+      </para>
+    </refsect2>
+
+    <refsect2 id="vboxmanage-debugvm-statistics">
+      <title>debugvm statistics</title>
+      <remark role="help-copy-synopsis"/>
+      <para>
+        Displays or resets VMM statistics.
+      </para>
+      <para>
+        Retrieves register values for guest CPUs and emulated devices.
+      </para>
+      <variablelist>
+        <varlistentry>
+          <term><option>--pattern <replaceable>pattern</replaceable></option></term>
+          <listitem><para>DOS/NT-style wildcards patterns for selecting statistics.  Multiple
+            patterns can be specified by using the '|' (pipe) character as separator.</para>
+          </listitem>
+        </varlistentry>
+        <varlistentry>
+          <term><option>--reset</option></term>
+          <listitem><para>Select reset instead of display mode.</para></listitem>
+        </varlistentry>
+      </variablelist>
+
+    </refsect2>
+
+  </refsect1>
+
+</refentry>
+
+
Index: /trunk/doc/manual/en_US/man_VBoxManage-extpack.xml
===================================================================
--- /trunk/doc/manual/en_US/man_VBoxManage-extpack.xml	(revision 56533)
+++ /trunk/doc/manual/en_US/man_VBoxManage-extpack.xml	(revision 56533)
@@ -0,0 +1,134 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    manpage, user manual, usage: VBoxManage extpack
+
+    Copyright (C) 2006-2015 Oracle Corporation
+
+    This file is part of VirtualBox Open Source Edition (OSE), as
+    available from http://www.virtualbox.org. This file is free software;
+    you can redistribute it and/or modify it under the terms of the GNU
+    General Public License (GPL) as published by the Free Software
+    Foundation, in version 2 as it comes in the "COPYING" file of the
+    VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+    hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ -->
+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
+<refentry id="vboxmanage-extpack" lang="en">
+
+  <refentryinfo>
+    <pubdate>$Date$</pubdate>
+    <title>VBoxManage extpack</title>
+  </refentryinfo>
+
+  <refmeta>
+    <refentrytitle>VBoxManage-extpack</refentrytitle>
+    <manvolnum>1</manvolnum>
+  </refmeta>
+
+  <refnamediv>
+    <refname>VBoxManage-extpack</refname>
+    <refpurpose>extension package management</refpurpose>
+    <refclass>Oracle VM VirtualBox</refclass>
+  </refnamediv>
+
+  <refsynopsisdiv>
+    <cmdsynopsis id="synopsis-vboxmanage-extpack-install"> <!-- The 'id' is mandatory and must start with 'synopsis-'. -->
+      <command>VBoxManage extpack install</command>
+      <arg>--replace</arg>
+      <arg choice="req"><replaceable>tarball</replaceable></arg>
+    </cmdsynopsis>
+    <cmdsynopsis id="synopsis-vboxmanage-extpack-uninstall">
+      <command>VBoxManage extpack uninstall</command>
+      <arg>--force</arg>
+      <arg choice="req"><replaceable>name</replaceable></arg>
+    </cmdsynopsis>
+    <cmdsynopsis id="synopsis-vboxmanage-extpack-cleanup">
+      <command>VBoxManage extpack cleanup</command>
+    </cmdsynopsis>
+  </refsynopsisdiv>
+
+  <refsect1>
+    <title>Description</title>
+
+    <refsect2 id="vboxmanage-extpack-install">
+      <title>extpack install</title>
+      <remark role="help-copy-synopsis"/>
+      <para>
+        Installs a new extension pack on the system.  This command will fail if an older
+        version of the same extension pack is already installed.  The
+        <option>--replace</option> option can be used to uninstall any
+        old package before the new one is installed.
+      </para>
+      <variablelist>
+        <varlistentry>
+          <term><option>--replace</option></term><listitem><para>Uninstall existing extension pack version.</para></listitem>
+        </varlistentry>
+        <varlistentry>
+          <term><replaceable>tarball</replaceable></term>
+          <listitem>
+            <para>The file containing the extension pack to be installed.</para>
+          </listitem>
+        </varlistentry>
+      </variablelist>
+    </refsect2>
+
+    <refsect2 id="vboxmanage-extpack-uninstall">
+      <title>extpack uninstall</title>
+      <remark role="help-copy-synopsis"/>
+      <para>
+        Uninstalls an extension pack from the system.  The subcommand will also succeed
+        in the case where the specified extension pack is not present on the system.
+        You can use <computeroutput>VBoxManage list extpacks</computeroutput> to show
+        the names of the extension packs which are currently installed.
+      </para>
+      <variablelist>
+        <varlistentry>
+          <term><option>--force</option></term>
+          <listitem>
+            <para>Overrides most refusals to uninstall an extension pack</para>
+          </listitem>
+        </varlistentry>
+        <varlistentry>
+          <term><replaceable>name</replaceable></term>
+          <listitem>
+            <para>The name of the extension pack to be uninstalled.</para>
+          </listitem>
+        </varlistentry>
+      </variablelist>
+    </refsect2>
+
+    <refsect2 id="vboxmanage-extpack-cleanup">
+      <title>extpack cleanup</title>
+      <remark role="help-copy-synopsis"/>
+      <para>
+        Used to remove temporary files and directories that may have been left behind
+        if a previous install or uninstall command failed.
+      </para>
+    </refsect2>
+
+  </refsect1>
+
+  <refsect1>
+    <title>Examples</title>
+    <remark role="help-scope" condition="EXTPACK_UNINSTALL,EXTPACK"/>
+    <para>
+          How to list extension packs:
+<screen>$ VBoxManage list extpacks
+Extension Packs: 1
+Pack no. 0:   Oracle VM VirtualBox Extension Pack
+Version:      4.1.12
+Revision:     77218
+Edition:
+Description:  USB 2.0 Host Controller, VirtualBox RDP, PXE ROM with E1000 support.
+VRDE Module:  VBoxVRDP
+Usable:       true
+Why unusable:</screen></para>
+
+    <para>How to remove an extension pack:
+<screen>$ VBoxManage extpack uninstall "Oracle VM VirtualBox Extension Pack"
+0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
+Successfully uninstalled "Oracle VM VirtualBox Extension Pack".</screen></para>
+  </refsect1>
+
+</refentry>
+
Index: unk/doc/manual/en_US/man_VBoxManage_debugvm.xml
===================================================================
--- /trunk/doc/manual/en_US/man_VBoxManage_debugvm.xml	(revision 56532)
+++ 	(revision )
@@ -1,358 +1,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-    manpage, user manual, usage: VBoxManage debugvm
-
-    Copyright (C) 2006-2015 Oracle Corporation
-
-    This file is part of VirtualBox Open Source Edition (OSE), as
-    available from http://www.virtualbox.org. This file is free software;
-    you can redistribute it and/or modify it under the terms of the GNU
-    General Public License (GPL) as published by the Free Software
-    Foundation, in version 2 as it comes in the "COPYING" file of the
-    VirtualBox OSE distribution. VirtualBox OSE is distributed in the
-    hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
- -->
-<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
-<refentry id="vboxmanage-debugvm" lang="en">
-
-  <refentryinfo>
-    <pubdate>$Date$</pubdate>
-    <title>VBoxManage debugvm</title>
-  </refentryinfo>
-
-  <refmeta>
-    <refentrytitle>VBoxManage-debugvm</refentrytitle>
-    <manvolnum>1</manvolnum>
-  </refmeta>
-
-  <refnamediv>
-    <refname>VBoxManage-debugvm</refname>
-    <refpurpose>introspection and guest debugging</refpurpose>
-    <refclass>Oracle VM VirtualBox</refclass>
-  </refnamediv>
-
-  <refsynopsisdiv>
-    <cmdsynopsis id="synopsis-vboxmanage-debugvm-dumpvmcore">
-      <command>VBoxManage debugvm</command>
-      <arg choice="req"><replaceable>uuid|vmname</replaceable></arg>
-      <arg choice="plain">dumpvmcore</arg>
-      <arg>--filename <replaceable>name</replaceable></arg>
-    </cmdsynopsis>
-    <cmdsynopsis id="synopsis-vboxmanage-debugvm-info">
-      <command>VBoxManage debugvm</command>
-      <arg choice="req"><replaceable>uuid|vmname</replaceable></arg>
-      <arg choice="plain">info</arg>
-      <arg choice="req"><replaceable>item</replaceable></arg>
-      <arg rep="repeat"><replaceable>args</replaceable></arg>
-    </cmdsynopsis>
-    <cmdsynopsis id="synopsis-vboxmanage-debugvm-injectnmi">
-      <command>VBoxManage debugvm</command>
-      <arg choice="req"><replaceable>uuid|vmname</replaceable></arg>
-      <arg choice="plain">injectnmi</arg>
-    </cmdsynopsis>
-    <cmdsynopsis id="synopsis-vboxmanage-debugvm-log">
-      <command>VBoxManage debugvm</command>
-      <arg choice="req"><replaceable>uuid|vmname</replaceable></arg>
-      <arg choice="plain">log</arg>
-      <group><arg>--release</arg><arg>--debug</arg></group>
-      <arg rep="repeat"><replaceable>group-settings</replaceable></arg>
-    </cmdsynopsis>
-    <cmdsynopsis id="synopsis-vboxmanage-debugvm-logdest">
-      <command>VBoxManage debugvm</command>
-      <arg choice="req"><replaceable>uuid|vmname</replaceable></arg>
-      <arg choice="plain">logdest</arg>
-      <group><arg>--release</arg><arg>--debug</arg></group>
-      <arg rep="repeat"><replaceable>destinations</replaceable></arg>
-    </cmdsynopsis>
-    <cmdsynopsis id="synopsis-vboxmanage-debugvm-logflags">
-      <command>VBoxManage debugvm</command>
-      <arg choice="req"><replaceable>uuid|vmname</replaceable></arg>
-      <arg choice="plain">logflags</arg>
-      <group><arg>--release</arg><arg>--debug</arg></group>
-      <arg rep="repeat"><replaceable>flags</replaceable></arg>
-    </cmdsynopsis>
-    <cmdsynopsis id="synopsis-vboxmanage-debugvm-osdetect">
-      <command>VBoxManage debugvm</command>
-      <arg choice="req"><replaceable>uuid|vmname</replaceable></arg>
-      <arg choice="plain">osdetect</arg>
-    </cmdsynopsis>
-    <cmdsynopsis id="synopsis-vboxmanage-debugvm-osinfo">
-      <command>VBoxManage debugvm</command>
-      <arg choice="req"><replaceable>uuid|vmname</replaceable></arg>
-      <arg choice="plain">osinfo</arg>
-    </cmdsynopsis>
-    <cmdsynopsis id="synopsis-vboxmanage-debugvm-osdmesg">
-      <command>VBoxManage debugvm</command>
-      <arg choice="req"><replaceable>uuid|vmname</replaceable></arg>
-      <arg choice="plain">osdmesg</arg>
-      <arg>--lines <replaceable>lines</replaceable></arg>
-    </cmdsynopsis>
-    <cmdsynopsis id="synopsis-vboxmanage-debugvm-getregisters">
-      <command>VBoxManage debugvm</command>
-      <arg choice="req"><replaceable>uuid|vmname</replaceable></arg>
-      <arg choice="plain">getregisters</arg>
-      <arg>--cpu <replaceable>id</replaceable></arg>
-      <arg rep="repeat"><replaceable>reg-set.reg-name</replaceable></arg>
-    </cmdsynopsis>
-    <cmdsynopsis id="synopsis-vboxmanage-debugvm-setregisters">
-      <command>VBoxManage debugvm</command>
-      <arg choice="req"><replaceable>uuid|vmname</replaceable></arg>
-      <arg choice="plain">setregisters</arg>
-      <arg>--cpu <replaceable>id</replaceable></arg>
-      <arg rep="repeat"><replaceable>reg-set.reg-name=value</replaceable></arg>
-    </cmdsynopsis>
-    <cmdsynopsis id="synopsis-vboxmanage-debugvm-show">
-      <command>VBoxManage debugvm</command>
-      <arg choice="req"><replaceable>uuid|vmname</replaceable></arg>
-      <arg choice="plain">show</arg>
-      <group><arg>--human-readable</arg><arg>--sh-export</arg><arg>--sh-eval</arg><arg>--cmd-set</arg></group>
-      <arg rep="repeat"><replaceable>settings-item</replaceable></arg>
-    </cmdsynopsis>
-    <cmdsynopsis id="synopsis-vboxmanage-debugvm-statistics">
-      <command>VBoxManage debugvm</command>
-      <arg choice="req"><replaceable>uuid|vmname</replaceable></arg>
-      <arg choice="plain">statistics</arg>
-      <arg>--reset</arg>
-      <arg>--descriptions</arg>
-      <arg>--pattern <replaceable>pattern</replaceable></arg>
-    </cmdsynopsis>
-  </refsynopsisdiv>
-  <refsect1>
-    <title>Description</title>
-
-    <para>The "debugvm" commands are for experts who want to tinker with the
-      exact details of virtual machine execution.  Like the VM debugger<remark role="help-manual">
-      described in <xref linkend="ts_debugger" /></remark>, these commands are only useful if you are
-      very familiar with the details of the PC architecture and how to debug
-      software.</para>
-
-    <refsect2 id="vboxmanage-debugvm-common-options">
-      <title>Common options</title>
-      <remark role="help-scope" condition="GLOBAL"/>
-      <para>The subcommands of <command>debugvm</command> all operate on a running virtual
-      machine:</para>
-      <variablelist>
-        <varlistentry>
-          <term><replaceable>uuid|vmname</replaceable></term>
-          <listitem><para>Either the UUID or the name (case sensitive) of a VM.</para></listitem>
-        </varlistentry>
-      </variablelist>
-    </refsect2>
-
-    <refsect2 id="vboxmanage-debugvm-dumpvmcore">
-      <title>debugvm dumpvmcore</title>
-      <remark role="help-copy-synopsis"/>
-      <para>
-        Creates a system dump file of the specified VM.  This file will have
-        the standard ELF core format (with custom sections)<remark role="help-manual">; see
-        <xref linkend="ts_guest-core-format" /></remark>.
-      </para>
-      <para>
-        This corresponds to the <command>writecore</command> command in the debugger.
-      </para>
-      <variablelist>
-        <varlistentry>
-          <term><option>--filename <replaceable>filename</replaceable></option></term>
-          <listitem><para>The name of the output file.</para></listitem>
-        </varlistentry>
-      </variablelist>
-    </refsect2>
-
-    <refsect2 id="vboxmanage-debugvm-info">
-      <title>debugvm info</title>
-      <remark role="help-copy-synopsis"/>
-      <para>
-        Displays info items relating to the VMM, device emulations and
-        associated drivers.
-      </para>
-      <para>
-        This corresponds to the <command>info</command> command in the debugger.
-      </para>
-      <variablelist>
-        <varlistentry>
-          <term><replaceable>info</replaceable></term>
-          <listitem>
-            <para>Name of the info item to display.  The special name
-            <option>help</option> will list all the available info items and
-            hints about optional arguments.</para>
-          </listitem>
-        </varlistentry>
-        <varlistentry>
-          <term><replaceable>args</replaceable></term>
-          <listitem>
-            <para>Optional argument string for the info item handler.  Most info items
-            does not take any extra arguments.  Arguments not recognized are generally
-            ignored.</para>
-          </listitem>
-        </varlistentry>
-      </variablelist>
-    </refsect2>
-
-    <refsect2 id="vboxmanage-debugvm-injectnmi">
-      <title>debugvm injectnmi</title>
-      <remark role="help-copy-synopsis"/>
-      <para>
-        Causes a non-maskable interrupt (NMI) to be injected into the guest. This
-        might be useful for certain debugging scenarios. What happens exactly is
-        dependent on the guest operating system, but an NMI can crash the whole
-        guest operating system. Do not use unless you know what you're doing.
-      </para>
-    </refsect2>
-
-    <refsect2 id="vboxmanage-debugvm-log">
-      <title>debugvm log</title>
-      <remark role="help-copy-synopsis"/>
-      <para>
-        TODO
-      </para>
-    </refsect2>
-
-    <refsect2 id="vboxmanage-debugvm-logdest">
-      <title>debugvm logdest</title>
-      <remark role="help-copy-synopsis"/>
-      <para>
-        TODO
-      </para>
-    </refsect2>
-
-    <refsect2 id="vboxmanage-debugvm-logflags">
-      <title>debugvm logflags</title>
-      <remark role="help-copy-synopsis"/>
-      <para>
-        TODO
-      </para>
-    </refsect2>
-
-    <refsect2 id="vboxmanage-debugvm-osdetect">
-      <title>debugvm osdetect</title>
-      <remark role="help-copy-synopsis"/>
-      <para>
-        Make the VMM's debugger facility (re)-detect the guest operating system (OS).
-        This will first load all debugger plug-ins.
-      </para>
-      <para>
-        This corresponds to the <command>detect</command> command in the debugger.
-      </para>
-    </refsect2>
-
-    <refsect2 id="vboxmanage-debugvm-osinfo">
-      <title>debugvm osinfo</title>
-      <remark role="help-copy-synopsis"/>
-      <para>
-        Displays information about the guest operating system (OS) previously
-        detected by the VMM's debugger facility.
-      </para>
-    </refsect2>
-
-    <refsect2 id="vboxmanage-debugvm-osdmesg">
-      <title>debugvm osdmesg</title>
-      <remark role="help-copy-synopsis"/>
-      <para>
-        Displays the guest OS kernel log, if detected and supported.
-      </para>
-      <variablelist>
-        <varlistentry>
-          <term><option>--lines <replaceable>lines</replaceable></option></term>
-          <listitem><para>Number of lines of the log to display, counting from
-          the end. The default is infinite.</para></listitem>
-        </varlistentry>
-      </variablelist>
-    </refsect2>
-
-    <refsect2 id="vboxmanage-debugvm-getregisters">
-      <title>debugvm getregisters</title>
-      <remark role="help-copy-synopsis"/>
-      <para>
-        Retrieves register values for guest CPUs and emulated devices.
-      </para>
-      <variablelist>
-        <varlistentry>
-          <term><replaceable>reg-set.reg-name</replaceable></term>
-          <listitem><para>One of more registers, each having one of the following forms:
-            <itemizedlist>
-              <listitem><para><computeroutput>register-set.register-name.sub-field</computeroutput></para></listitem>
-              <listitem><para><computeroutput>register-set.register-name</computeroutput></para></listitem>
-              <listitem><para><computeroutput>cpu-register-name.sub-field</computeroutput></para></listitem>
-              <listitem><para><computeroutput>cpu-register-name</computeroutput></para></listitem>
-              <listitem><para><computeroutput>all</computeroutput></para></listitem>
-            </itemizedlist>
-            The <replaceable>all</replaceable> form will cause all registers
-            to be shown (no sub-fields).  The registers names are case-insensitive.
-          </para></listitem>
-        </varlistentry>
-        <varlistentry>
-          <term><option>--cpu <replaceable>id</replaceable></option></term>
-          <listitem><para>Selects the CPU register set when specifying just a
-            CPU register (3rd and 4th form).  The default is 0.</para>
-          </listitem>
-        </varlistentry>
-      </variablelist>
-    </refsect2>
-
-    <refsect2 id="vboxmanage-debugvm-setregisters">
-      <title>debugvm setregisters</title>
-      <remark role="help-copy-synopsis"/>
-      <para>
-        Changes register values for guest CPUs and emulated devices.
-      </para>
-      <variablelist>
-        <varlistentry>
-          <term><replaceable>reg-set.reg-name=value</replaceable></term>
-          <listitem><para>One of more register assignment, each having one of the following forms:
-            <itemizedlist>
-              <listitem><para><computeroutput>register-set.register-name.sub-field=value</computeroutput></para></listitem>
-              <listitem><para><computeroutput>register-set.register-name=value</computeroutput></para></listitem>
-              <listitem><para><computeroutput>cpu-register-name.sub-field=value</computeroutput></para></listitem>
-              <listitem><para><computeroutput>cpu-register-name=value</computeroutput></para></listitem>
-            </itemizedlist>
-            The value format should be in the same style as what <command>getregisters</command>
-            displays, with the exception that both octal and decimal can be used instead of
-            hexadecimal.
-          </para></listitem>
-        </varlistentry>
-        <varlistentry>
-          <term><option>--cpu <replaceable>id</replaceable></option></term>
-          <listitem><para>Selects the CPU register set when specifying just a
-            CPU register (3rd and 4th form).  The default is 0.</para>
-          </listitem>
-        </varlistentry>
-      </variablelist>
-    </refsect2>
-
-    <refsect2 id="vboxmanage-debugvm-show">
-      <title>debugvm show</title>
-      <remark role="help-copy-synopsis"/>
-      <para>
-        TODO
-      </para>
-    </refsect2>
-
-    <refsect2 id="vboxmanage-debugvm-statistics">
-      <title>debugvm statistics</title>
-      <remark role="help-copy-synopsis"/>
-      <para>
-        Displays or resets VMM statistics.
-      </para>
-      <para>
-        Retrieves register values for guest CPUs and emulated devices.
-      </para>
-      <variablelist>
-        <varlistentry>
-          <term><option>--pattern <replaceable>pattern</replaceable></option></term>
-          <listitem><para>DOS/NT-style wildcards patterns for selecting statistics.  Multiple
-            patterns can be specified by using the '|' (pipe) character as separator.</para>
-          </listitem>
-        </varlistentry>
-        <varlistentry>
-          <term><option>--reset</option></term>
-          <listitem><para>Select reset instead of display mode.</para></listitem>
-        </varlistentry>
-      </variablelist>
-
-    </refsect2>
-
-  </refsect1>
-
-</refentry>
-
-
Index: unk/doc/manual/en_US/man_VBoxManage_extpack.xml
===================================================================
--- /trunk/doc/manual/en_US/man_VBoxManage_extpack.xml	(revision 56532)
+++ 	(revision )
@@ -1,134 +1,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-    manpage, user manual, usage: VBoxManage extpack
-
-    Copyright (C) 2006-2015 Oracle Corporation
-
-    This file is part of VirtualBox Open Source Edition (OSE), as
-    available from http://www.virtualbox.org. This file is free software;
-    you can redistribute it and/or modify it under the terms of the GNU
-    General Public License (GPL) as published by the Free Software
-    Foundation, in version 2 as it comes in the "COPYING" file of the
-    VirtualBox OSE distribution. VirtualBox OSE is distributed in the
-    hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
- -->
-<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
-<refentry id="vboxmanage-extpack" lang="en">
-
-  <refentryinfo>
-    <pubdate>$Date$</pubdate>
-    <title>VBoxManage extpack</title>
-  </refentryinfo>
-
-  <refmeta>
-    <refentrytitle>VBoxManage-extpack</refentrytitle>
-    <manvolnum>1</manvolnum>
-  </refmeta>
-
-  <refnamediv>
-    <refname>VBoxManage-extpack</refname>
-    <refpurpose>extension package management</refpurpose>
-    <refclass>Oracle VM VirtualBox</refclass>
-  </refnamediv>
-
-  <refsynopsisdiv>
-    <cmdsynopsis id="synopsis-vboxmanage-extpack-install"> <!-- The 'id' is mandatory and must start with 'synopsis-'. -->
-      <command>VBoxManage extpack install</command>
-      <arg>--replace</arg>
-      <arg choice="req"><replaceable>tarball</replaceable></arg>
-    </cmdsynopsis>
-    <cmdsynopsis id="synopsis-vboxmanage-extpack-uninstall">
-      <command>VBoxManage extpack uninstall</command>
-      <arg>--force</arg>
-      <arg choice="req"><replaceable>name</replaceable></arg>
-    </cmdsynopsis>
-    <cmdsynopsis id="synopsis-vboxmanage-extpack-cleanup">
-      <command>VBoxManage extpack cleanup</command>
-    </cmdsynopsis>
-  </refsynopsisdiv>
-
-  <refsect1>
-    <title>Description</title>
-
-    <refsect2 id="vboxmanage-extpack-install">
-      <title>extpack install</title>
-      <remark role="help-copy-synopsis"/>
-      <para>
-        Installs a new extension pack on the system.  This command will fail if an older
-        version of the same extension pack is already installed.  The
-        <option>--replace</option> option can be used to uninstall any
-        old package before the new one is installed.
-      </para>
-      <variablelist>
-        <varlistentry>
-          <term><option>--replace</option></term><listitem><para>Uninstall existing extension pack version.</para></listitem>
-        </varlistentry>
-        <varlistentry>
-          <term><replaceable>tarball</replaceable></term>
-          <listitem>
-            <para>The file containing the extension pack to be installed.</para>
-          </listitem>
-        </varlistentry>
-      </variablelist>
-    </refsect2>
-
-    <refsect2 id="vboxmanage-extpack-uninstall">
-      <title>extpack uninstall</title>
-      <remark role="help-copy-synopsis"/>
-      <para>
-        Uninstalls an extension pack from the system.  The subcommand will also succeed
-        in the case where the specified extension pack is not present on the system.
-        You can use <computeroutput>VBoxManage list extpacks</computeroutput> to show
-        the names of the extension packs which are currently installed.
-      </para>
-      <variablelist>
-        <varlistentry>
-          <term><option>--force</option></term>
-          <listitem>
-            <para>Overrides most refusals to uninstall an extension pack</para>
-          </listitem>
-        </varlistentry>
-        <varlistentry>
-          <term><replaceable>name</replaceable></term>
-          <listitem>
-            <para>The name of the extension pack to be uninstalled.</para>
-          </listitem>
-        </varlistentry>
-      </variablelist>
-    </refsect2>
-
-    <refsect2 id="vboxmanage-extpack-cleanup">
-      <title>extpack cleanup</title>
-      <remark role="help-copy-synopsis"/>
-      <para>
-        Used to remove temporary files and directories that may have been left behind
-        if a previous install or uninstall command failed.
-      </para>
-    </refsect2>
-
-  </refsect1>
-
-  <refsect1>
-    <title>Examples</title>
-    <remark role="help-scope" condition="EXTPACK_UNINSTALL,EXTPACK"/>
-    <para>
-          How to list extension packs:
-<screen>$ VBoxManage list extpacks
-Extension Packs: 1
-Pack no. 0:   Oracle VM VirtualBox Extension Pack
-Version:      4.1.12
-Revision:     77218
-Edition:
-Description:  USB 2.0 Host Controller, VirtualBox RDP, PXE ROM with E1000 support.
-VRDE Module:  VBoxVRDP
-Usable:       true
-Why unusable:</screen></para>
-
-    <para>How to remove an extension pack:
-<screen>$ VBoxManage extpack uninstall "Oracle VM VirtualBox Extension Pack"
-0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
-Successfully uninstalled "Oracle VM VirtualBox Extension Pack".</screen></para>
-  </refsect1>
-
-</refentry>
-
Index: /trunk/doc/manual/en_US/user_VBoxManage.xml
===================================================================
--- /trunk/doc/manual/en_US/user_VBoxManage.xml	(revision 56532)
+++ /trunk/doc/manual/en_US/user_VBoxManage.xml	(revision 56533)
@@ -4522,8 +4522,8 @@
   </sect1>
 
-  <xi:include href="man_VBoxManage_debugvm.xml" xpointer="element(/1)"
+  <xi:include href="user_man_VBoxManage-debugvm.xml" xpointer="element(/1)"
     xmlns:xi="http://www.w3.org/2001/XInclude" />
 
-  <xi:include href="man_VBoxManage_extpack.xml" xpointer="element(/1)"
+  <xi:include href="user_man_VBoxManage-extpack.xml" xpointer="element(/1)"
     xmlns:xi="http://www.w3.org/2001/XInclude" />
 </chapter>
Index: /trunk/include/VBox/refentry.h
===================================================================
--- /trunk/include/VBox/refentry.h	(revision 56532)
+++ /trunk/include/VBox/refentry.h	(revision 56533)
@@ -43,10 +43,17 @@
 #define REFENTRY_NBSP               '\b'
 
-/** @name REFENTRYSTR_SCOPE_XXX - Common string scoping.
+/** @name REFENTRYSTR_SCOPE_XXX - Common string scoping and flags.
  * @{ */
-/** Same scope as previous string table entry. */
+/** Same scope as previous string table entry, flags are reset and can be
+ *  ORed in. */
 #define REFENTRYSTR_SCOPE_SAME      UINT64_C(0)
 /** Global scope. */
-#define REFENTRYSTR_SCOPE_GLOBAL    UINT64_MAX
+#define REFENTRYSTR_SCOPE_GLOBAL    UINT64_C(0x00ffffffffffffff)
+/** Scope mask. */
+#define REFENTRYSTR_SCOPE_MASK      UINT64_C(0x00ffffffffffffff)
+/** Flags mask. */
+#define REFENTRYSTR_FLAGS_MASK      UINT64_C(0xff00000000000000)
+/** Command synopsis, special hanging indent rules applies. */
+#define REFENTRYSTR_FLAGS_SYNOPSIS  RT_BIT_64(63)
 /** @} */
 
Index: /trunk/src/VBox/Frontends/VBoxManage/VBoxManageHelp.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VBoxManage/VBoxManageHelp.cpp	(revision 56532)
+++ /trunk/src/VBox/Frontends/VBoxManage/VBoxManageHelp.cpp	(revision 56533)
@@ -44,6 +44,7 @@
 enum HELP_CMD_VBOXMANAGE    g_enmCurCommand = HELP_CMD_VBOXMANAGE_INVALID;
 /** The scope maskt for the current subcommand. */
-uint64_t                    g_fCurSubcommandScope = UINT64_MAX;
-
+uint64_t                    g_fCurSubcommandScope = REFENTRYSTR_SCOPE_GLOBAL;
+/** String of spaces that can be used for indentation.   */
+static const char           g_szSpaces[] = "                                                ";
 
 /**
@@ -58,5 +59,5 @@
     Assert(g_enmCurCommand == HELP_CMD_VBOXMANAGE_INVALID);
     g_enmCurCommand       = enmCommand;
-    g_fCurSubcommandScope = UINT64_MAX;
+    g_fCurSubcommandScope = REFENTRYSTR_SCOPE_GLOBAL;
 }
 
@@ -104,6 +105,7 @@
  * @param   psz             The string table string to print.
  * @param   cchMaxWidth     The maximum output width.
- */
-static uint32_t printString(PRTSTREAM pStrm, const char *psz, uint32_t cchMaxWidth)
+ * @param   fFlags          String flags that may affect formatting.
+ */
+static uint32_t printString(PRTSTREAM pStrm, const char *psz, uint32_t cchMaxWidth, uint64_t fFlags)
 {
     uint32_t    cLinesWritten;
@@ -142,14 +144,17 @@
         while (*psz == ' ')
             cchIndent++, psz++;
+        Assert(cchIndent + 4 + 1 <= RT_ELEMENTS(g_szSpaces));
+
         if (cchIndent + 8 >= cchMaxWidth)
             cchMaxWidth += cchIndent + 8;
 
         /* Work our way thru the string, line by line. */
+        uint32_t cchHangingIndent = 0;
         cLinesWritten = 0;
         do
         {
-            RTStrmWrite(pStrm, pszIndent, cchIndent);
-            size_t offLine       = cchIndent;
-            bool   fPendingSpace = false;
+            RTStrmWrite(pStrm, g_szSpaces, cchIndent + cchHangingIndent);
+            size_t   offLine       = cchIndent + cchHangingIndent;
+            bool     fPendingSpace = false;
             do
             {
@@ -183,4 +188,8 @@
             RTStrmPutCh(pStrm, '\n');
             cLinesWritten++;
+
+            /* Set up hanging indent if relevant. */
+            if (fFlags & REFENTRYSTR_FLAGS_SYNOPSIS)
+                cchHangingIndent = 4;
         } while (*psz != '\0');
     }
@@ -223,7 +232,10 @@
     {
         uint64_t fCurScope = pStrTab->paStrings[i].fScope;
-        if (fCurScope == REFENTRYSTR_SCOPE_SAME)
-            fCurScope = fPrevScope;
-        if (fCurScope & fScope)
+        if ((fCurScope & REFENTRYSTR_SCOPE_MASK) == REFENTRYSTR_SCOPE_SAME)
+        {
+            fCurScope &= ~REFENTRYSTR_SCOPE_MASK;
+            fCurScope |= (fPrevScope & REFENTRYSTR_SCOPE_MASK);
+        }
+        if (fCurScope & REFENTRYSTR_SCOPE_MASK & fScope)
         {
             const char *psz = pStrTab->paStrings[i].psz;
@@ -236,5 +248,5 @@
                     cLinesWritten++;
                 }
-                cLinesWritten += printString(pStrm, psz, cchWidth);
+                cLinesWritten += printString(pStrm, psz, cchWidth, fCurScope & REFENTRYSTR_FLAGS_MASK);
             }
             else
@@ -255,5 +267,6 @@
  * @returns Number of lines written.
  * @param   enmCommand          The command.
- * @param   fSubcommandScope    The subcommand scope, UINT64_MAX for all.
+ * @param   fSubcommandScope    The subcommand scope, REFENTRYSTR_SCOPE_GLOBAL
+ *                              for all.
  * @param   pStrm               The output stream.
  */
@@ -301,5 +314,6 @@
  *
  * @param   enmCommand          The command.
- * @param   fSubcommandScope    The subcommand scope, UINT64_MAX for all.
+ * @param   fSubcommandScope    The subcommand scope, REFENTRYSTR_SCOPE_GLOBAL
+ *                              for all.
  * @param   pStrm               The output stream.
  */
@@ -343,5 +357,5 @@
 {
     Assert(g_enmCurCommand != HELP_CMD_VBOXMANAGE_INVALID);
-    Assert(g_fCurSubcommandScope == UINT64_MAX);
+    Assert(g_fCurSubcommandScope == REFENTRYSTR_SCOPE_GLOBAL);
 
     return errorSyntax("No subcommand specified");
@@ -360,5 +374,5 @@
 {
     Assert(g_enmCurCommand != HELP_CMD_VBOXMANAGE_INVALID);
-    Assert(g_fCurSubcommandScope == UINT64_MAX);
+    Assert(g_fCurSubcommandScope == REFENTRYSTR_SCOPE_GLOBAL);
 
     /* check if help was requested. */
@@ -387,5 +401,5 @@
 {
     Assert(g_enmCurCommand != HELP_CMD_VBOXMANAGE_INVALID);
-    Assert(g_fCurSubcommandScope != UINT64_MAX);
+    Assert(g_fCurSubcommandScope != REFENTRYSTR_SCOPE_GLOBAL);
 
     /* check if help was requested. */
