Changeset 94290 in vbox for trunk/src/VBox/Frontends/VBoxManage/VBoxManageHelp.cpp
- Timestamp:
- Mar 17, 2022 12:47:49 PM (3 years ago)
- svn:sync-xref-src-repo-rev:
- 150557
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxManage/VBoxManageHelp.cpp
r94240 r94290 49 49 DECLARE_TRANSLATION_CONTEXT(Help); 50 50 51 static enum HELP_CMD_VBOXMANAGE g_enmCurCommand = HELP_CMD_ VBOXMANAGE_INVALID;51 static enum HELP_CMD_VBOXMANAGE g_enmCurCommand = HELP_CMD_COMMON; 52 52 /** The scope mask for the current subcommand. */ 53 53 static uint64_t g_fCurSubcommandScope = RTMSGREFENTRYSTR_SCOPE_GLOBAL; … … 62 62 void setCurrentCommand(enum HELP_CMD_VBOXMANAGE enmCommand) 63 63 { 64 Assert(g_enmCurCommand == HELP_CMD_ VBOXMANAGE_INVALID);64 Assert(g_enmCurCommand == HELP_CMD_COMMON); 65 65 g_enmCurCommand = enmCommand; 66 66 g_fCurSubcommandScope = RTMSGREFENTRYSTR_SCOPE_GLOBAL; … … 128 128 { 129 129 PCRTMSGREFENTRY pHelp = apHelpLangEntries[k]->papHelpEntries[i]; 130 if (pHelp->idInternal == (int64_t)enmCommand) 130 if ( pHelp->idInternal == (int64_t)enmCommand 131 || enmCommand == HELP_CMD_COMMON) 131 132 { 132 133 cFound++; … … 194 195 195 196 if ( pHelp->idInternal == (int64_t)enmCommand 196 || enmCommand == HELP_CMD_ VBOXMANAGE_INVALID)197 || enmCommand == HELP_CMD_COMMON) 197 198 { 198 199 cFound++; … … 503 504 } 504 505 } 505 506 507 508 509 void printUsage(USAGECATEGORY enmCommand, uint64_t fSubcommandScope, PRTSTREAM pStrm)510 {511 RT_NOREF(fSubcommandScope);512 513 Assert(enmCommand != USAGE_INVALID);514 Assert(enmCommand != USAGE_S_NEWCMD);515 516 if (enmCommand == USAGE_S_DUMPOPTS)517 enmCommand = USAGE_S_ALL;518 519 RTStrmPrintf(pStrm,520 Help::tr("Usage:\n"521 "\n"));522 523 if (enmCommand == USAGE_S_ALL)524 RTStrmPrintf(pStrm,525 " VBoxManage [<general option>] <command>\n"526 "\n"527 "\n"528 "General Options:\n"529 "\n"530 " [-V|--version] print version number and exit\n"531 " [--dump-build-type] print build type and exit\n"532 " [-q|--nologo] suppress the logo\n"533 " [--settingspw <pw>] provide the settings password\n"534 " [--settingspwfile <file>] provide a file containing the settings password\n"535 " [@<response-file>] load arguments from the given response file (bourne style)\n"536 "\n"537 "\n"538 "Commands:\n"539 "\n");540 541 if (enmCommand == USAGE_S_ALL)542 {543 uint32_t cPendingBlankLines = 0;544 PCHELP_LANG_ENTRY_T pHelpLangEntry = ASMAtomicUoReadPtrT(&g_pHelpLangEntry, PCHELP_LANG_ENTRY_T);545 uint32_t const cHelpEntries = *pHelpLangEntry->pcHelpEntries;546 for (uint32_t i = 0; i < cHelpEntries; i++)547 {548 PCRTMSGREFENTRY pHelp = pHelpLangEntry->papHelpEntries[i];549 550 while (cPendingBlankLines-- > 0)551 RTStrmPutCh(pStrm, '\n');552 553 char szFirstChar[8];554 RTStrmPrintf(pStrm, " %s%s:\n", szFirstChar, captialize(pHelp->pszBrief, szFirstChar));555 556 cPendingBlankLines = 0;557 RTMsgRefEntryPrintStringTable(pStrm, &pHelp->Synopsis, RTMSGREFENTRYSTR_SCOPE_GLOBAL,558 &cPendingBlankLines, NULL /*pcLinesWritten*/);559 cPendingBlankLines = RT_MAX(cPendingBlankLines, 1);560 }561 }562 }
Note:
See TracChangeset
for help on using the changeset viewer.