===========================================================================
| 76 | |
| 77 | //=========================================================================== |
| 78 | void Help_Categories() |
| 79 | { |
| 80 | // TODO/FIXME: Colorize( sText, ... ) |
| 81 | // Colorize("Usage:") |
| 82 | std::string sText = CHC_USAGE "Usage" CHC_DEFAULT ": " CHC_ARG_OPT "[ " CHC_ARG_MAND "< "; |
| 83 | |
| 84 | for (int iCategory = _PARAM_HELPCATEGORIES_BEGIN ; iCategory < _PARAM_HELPCATEGORIES_END; iCategory++) |
| 85 | { |
| 86 | const char *pName = g_aParameters[ iCategory ].m_sName; |
| 87 | |
| 88 | if (sText.length() + strlen(pName) >= (CONSOLE_WIDTH - 1)) |
| 89 | { |
| 90 | ConsolePrint( sText.c_str() ); |
| 91 | sText = " "; // indent |
| 92 | } |
| 93 | |
| 94 | sText += CHC_COMMAND; |
| 95 | sText += pName; |
| 96 | |
| 97 | if (iCategory < (_PARAM_HELPCATEGORIES_END - 1)) |
| 98 | { |
| 99 | const char sSep[] = " | "; |
| 100 | |
| 101 | if (sText.length() + strlen(sSep) >= (CONSOLE_WIDTH - 1)) |
| 102 | { |
| 103 | ConsolePrint( sText.c_str() ); |
| 104 | sText = " "; // indent |
| 105 | } |
| 106 | |
| 107 | sText += CHC_ARG_SEP; |
| 108 | sText += sSep; |
| 109 | } |
| 110 | } |
| 111 | |
| 112 | sText += CHC_ARG_MAND " >" CHC_ARG_OPT " ]"; |
| 113 | |
| 114 | // ConsoleBufferPush( sText.c_str() ); |
| 115 | ConsolePrint( sText.c_str() ); // Transcode colored text to native console color text |
| 116 | |
| 117 | ConsolePrintFormat( CHC_USAGE "Notes" CHC_DEFAULT ": " |
| 118 | CHC_ARG_MAND "<>" CHC_DEFAULT " = mandatory, " |
| 119 | CHC_ARG_OPT "[]" CHC_DEFAULT " = optional, " |
| 120 | CHC_ARG_SEP "|" CHC_DEFAULT " argument option" ); |
| 121 | // ConsoleBufferPush( sText.c_str() ); |
| 122 | } |
| 123 | |
| 124 | void Help_Examples() |
| 125 | { |
no test coverage detected