Index: /trunk/src/VBox/Frontends/VBoxManage/VBoxManageDebugVM.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VBoxManage/VBoxManageDebugVM.cpp	(revision 39674)
+++ /trunk/src/VBox/Frontends/VBoxManage/VBoxManageDebugVM.cpp	(revision 39675)
@@ -404,4 +404,80 @@
 }
 
+/** @name debugvm show flags
+ * @{ */
+#define DEBUGVM_SHOW_FLAGS_HUMAN_READABLE   UINT32_C(0x00000000)
+#define DEBUGVM_SHOW_FLAGS_SH_EXPORT        UINT32_C(0x00000001)
+#define DEBUGVM_SHOW_FLAGS_SH_EVAL          UINT32_C(0x00000002)
+#define DEBUGVM_SHOW_FLAGS_CMD_SET          UINT32_C(0x00000003)
+#define DEBUGVM_SHOW_FLAGS_FMT_MASK         UINT32_C(0x00000003)
+/** @} */
+
+/**
+ * Prints a variable according to the @a fFlags.
+ *
+ * @param   pszVar              The variable name.
+ * @param   pbstrValue          The variable value.
+ * @param   fFlags              The debugvm show flags.
+ */
+static void handleDebugVM_Show_PrintVar(const char *pszVar, com::Bstr const *pbstrValue, uint32_t fFlags)
+{
+    switch (fFlags & DEBUGVM_SHOW_FLAGS_FMT_MASK)
+    {
+        case DEBUGVM_SHOW_FLAGS_HUMAN_READABLE: RTPrintf(" %27s=%ls\n", pszVar, pbstrValue->raw()); break;
+        case DEBUGVM_SHOW_FLAGS_SH_EXPORT:      RTPrintf("export %s='%ls'\n", pszVar, pbstrValue->raw()); break;
+        case DEBUGVM_SHOW_FLAGS_SH_EVAL:        RTPrintf("%s='%ls'\n", pszVar, pbstrValue->raw()); break;
+        case DEBUGVM_SHOW_FLAGS_CMD_SET:        RTPrintf("set %s=%ls\n", pszVar, pbstrValue->raw()); break;
+        default: AssertFailed();
+    }
+}
+
+/**
+ * Handles logdbg-settings.
+ *
+ * @returns Exit code.
+ * @param   pDebugger           The debugger interface.
+ * @param   fFlags              The debugvm show flags.
+ */
+static RTEXITCODE handleDebugVM_Show_LogDbgSettings(IMachineDebugger *pDebugger, uint32_t fFlags)
+{
+    if ((fFlags & DEBUGVM_SHOW_FLAGS_FMT_MASK) == DEBUGVM_SHOW_FLAGS_HUMAN_READABLE)
+        RTPrintf("Debug logger settings:\n");
+
+    com::Bstr bstr;
+    CHECK_ERROR2_RET(pDebugger, COMGETTER(LogDbgFlags)(bstr.asOutParam()), RTEXITCODE_FAILURE);
+    handleDebugVM_Show_PrintVar("VBOX_LOG", &bstr, fFlags);
+
+    CHECK_ERROR2_RET(pDebugger, COMGETTER(LogDbgGroups)(bstr.asOutParam()), RTEXITCODE_FAILURE);
+    handleDebugVM_Show_PrintVar("VBOX_LOG_FLAGS", &bstr, fFlags);
+
+    CHECK_ERROR2_RET(pDebugger, COMGETTER(LogDbgDestinations)(bstr.asOutParam()), RTEXITCODE_FAILURE);
+    handleDebugVM_Show_PrintVar("VBOX_LOG_DEST", &bstr, fFlags);
+    return RTEXITCODE_SUCCESS;
+}
+
+/**
+ * Handles logrel-settings.
+ *
+ * @returns Exit code.
+ * @param   pDebugger           The debugger interface.
+ * @param   fFlags              The debugvm show flags.
+ */
+static RTEXITCODE handleDebugVM_Show_LogRelSettings(IMachineDebugger *pDebugger, uint32_t fFlags)
+{
+    if ((fFlags & DEBUGVM_SHOW_FLAGS_FMT_MASK) == DEBUGVM_SHOW_FLAGS_HUMAN_READABLE)
+        RTPrintf("Release logger settings:\n");
+
+    com::Bstr bstr;
+    CHECK_ERROR2_RET(pDebugger, COMGETTER(LogRelFlags)(bstr.asOutParam()), RTEXITCODE_FAILURE);
+    handleDebugVM_Show_PrintVar("VBOX_RELEASE_LOG", &bstr, fFlags);
+
+    CHECK_ERROR2_RET(pDebugger, COMGETTER(LogRelGroups)(bstr.asOutParam()), RTEXITCODE_FAILURE);
+    handleDebugVM_Show_PrintVar("VBOX_RELEASE_LOG_FLAGS", &bstr, fFlags);
+
+    CHECK_ERROR2_RET(pDebugger, COMGETTER(LogRelDestinations)(bstr.asOutParam()), RTEXITCODE_FAILURE);
+    handleDebugVM_Show_PrintVar("VBOX_RELEASE_LOG_DEST", &bstr, fFlags);
+    return RTEXITCODE_SUCCESS;
+}
+
 /**
  * Handles the show sub-command.
@@ -413,40 +489,65 @@
 static RTEXITCODE handleDebugVM_Show(HandlerArg *pArgs, IMachineDebugger *pDebugger)
 {
-    if (pArgs->argc != 3)
-        return errorSyntax(USAGE_DEBUGVM, "The show sub-command takes exactly one argument");
-
-    const char *pszWhat = pArgs->argv[2];
-    if (   !strcmp(pszWhat, "log-settings")
-        || !strcmp(pszWhat, "logdbg-settings"))
-    {
-        com::Bstr bstrFlags;
-        CHECK_ERROR2_RET(pDebugger, COMGETTER(LogDbgFlags)(bstrFlags.asOutParam()), RTEXITCODE_FAILURE);
-        com::Bstr bstrGroups;
-        CHECK_ERROR2_RET(pDebugger, COMGETTER(LogDbgGroups)(bstrGroups.asOutParam()), RTEXITCODE_FAILURE);
-        com::Bstr bstrDestinations;
-        CHECK_ERROR2_RET(pDebugger, COMGETTER(LogDbgDestinations)(bstrDestinations.asOutParam()), RTEXITCODE_FAILURE);
-        RTPrintf("Debug log settings:\n");
-        RTPrintf("        VBOX_LOG=%ls\n"
-                 "  VBOX_LOG_FLAGS=%ls\n"
-                 "   VBOX_LOG_DEST=%ls\n"
-                 , bstrGroups.raw(), bstrFlags.raw(), bstrDestinations.raw());
-    }
-    else if (!strcmp(pszWhat, "logrel-settings"))
-    {
-        com::Bstr bstrFlags;
-        CHECK_ERROR2_RET(pDebugger, COMGETTER(LogRelFlags)(bstrFlags.asOutParam()), RTEXITCODE_FAILURE);
-        com::Bstr bstrGroups;
-        CHECK_ERROR2_RET(pDebugger, COMGETTER(LogRelGroups)(bstrGroups.asOutParam()), RTEXITCODE_FAILURE);
-        com::Bstr bstrDestinations;
-        CHECK_ERROR2_RET(pDebugger, COMGETTER(LogRelDestinations)(bstrDestinations.asOutParam()), RTEXITCODE_FAILURE);
-        RTPrintf("Release log settings:\n");
-        RTPrintf("        VBOX_RELEASE_LOG=%ls\n"
-                 "  VBOX_RELEASE_LOG_FLAGS=%ls\n"
-                 "   VBOX_RELEASE_LOG_DEST=%ls\n"
-                 , bstrGroups.raw(), bstrFlags.raw(), bstrDestinations.raw());
-    }
-    else
-        return errorSyntax(USAGE_DEBUGVM, "The show sub-command has no idea what '%s' might be", pszWhat);
-
+    /*
+     * Parse arguments and what to show.  Order dependent.
+     */
+    uint32_t                    fFlags = DEBUGVM_SHOW_FLAGS_HUMAN_READABLE;
+
+    RTGETOPTSTATE               GetState;
+    RTGETOPTUNION               ValueUnion;
+    static const RTGETOPTDEF    s_aOptions[] =
+    {
+        { "--human-readable", 'H', RTGETOPT_REQ_NOTHING },
+        { "--sh-export",      'e', RTGETOPT_REQ_NOTHING },
+        { "--sh-eval",        'E', RTGETOPT_REQ_NOTHING },
+        { "--cmd-set",        's', RTGETOPT_REQ_NOTHING  },
+    };
+    int rc = RTGetOptInit(&GetState, pArgs->argc, pArgs->argv, s_aOptions, RT_ELEMENTS(s_aOptions), 2, 0 /*fFlags*/);
+    AssertRCReturn(rc, RTEXITCODE_FAILURE);
+
+    while ((rc = RTGetOpt(&GetState, &ValueUnion)) != 0)
+    {
+        switch (rc)
+        {
+            case 'H':
+                fFlags = (fFlags & ~DEBUGVM_SHOW_FLAGS_FMT_MASK) | DEBUGVM_SHOW_FLAGS_HUMAN_READABLE;
+                break;
+
+            case 'e':
+                fFlags = (fFlags & ~DEBUGVM_SHOW_FLAGS_FMT_MASK) | DEBUGVM_SHOW_FLAGS_SH_EXPORT;
+                break;
+
+            case 'E':
+                fFlags = (fFlags & ~DEBUGVM_SHOW_FLAGS_FMT_MASK) | DEBUGVM_SHOW_FLAGS_SH_EVAL;
+                break;
+
+            case 's':
+                fFlags = (fFlags & ~DEBUGVM_SHOW_FLAGS_FMT_MASK) | DEBUGVM_SHOW_FLAGS_CMD_SET;
+                break;
+
+            case VINF_GETOPT_NOT_OPTION:
+            {
+                RTEXITCODE rcExit;
+                if (!strcmp(ValueUnion.psz, "log-settings"))
+                {
+                    rcExit = handleDebugVM_Show_LogDbgSettings(pDebugger, fFlags);
+                    if (rcExit == RTEXITCODE_SUCCESS)
+                        rcExit = handleDebugVM_Show_LogRelSettings(pDebugger, fFlags);
+                }
+                else if (!strcmp(ValueUnion.psz, "logdbg-settings"))
+                    rcExit = handleDebugVM_Show_LogDbgSettings(pDebugger, fFlags);
+                else if (!strcmp(ValueUnion.psz, "logrel-settings"))
+                    rcExit = handleDebugVM_Show_LogRelSettings(pDebugger, fFlags);
+                else
+                    rcExit = errorSyntax(USAGE_DEBUGVM, "The show sub-command has no idea what '%s' might be", ValueUnion.psz);
+                if (rcExit != RTEXITCODE_SUCCESS)
+                    return rcExit;
+                break;
+            }
+
+            default:
+                return errorGetOpt(USAGE_DEBUGVM, rc, &ValueUnion);
+        }
+    }
     return RTEXITCODE_SUCCESS;
 }
Index: /trunk/src/VBox/Frontends/VBoxManage/VBoxManageHelp.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VBoxManage/VBoxManageHelp.cpp	(revision 39674)
+++ /trunk/src/VBox/Frontends/VBoxManage/VBoxManageHelp.cpp	(revision 39675)
@@ -652,5 +652,6 @@
                      "                            getregisters [--cpu <id>] <reg>|all ... |\n"
                      "                            setregisters [--cpu <id>] <reg>=<value> ... |\n"
-                     "                            show <logdbg-settings|logrel-settings> |\n"
+                     "                            show [--human-readable|--sh-export|--sh-eval|--cmd-set] \n"
+                     "                                <logdbg-settings|logrel-settings> [[opt] what ...] |\n"
                      "                            statistics [--reset] [--pattern <pattern>]\n"
                      "                            [--descriptions]\n"
