diff options
author | Alex Turbov <i.zaufi@gmail.com> | 2022-08-23 17:39:53 (GMT) |
---|---|---|
committer | Alex Turbov <i.zaufi@gmail.com> | 2022-11-17 12:37:11 (GMT) |
commit | 74b735dea8e2255c53f12afea5706ad443d64785 (patch) | |
tree | 03933961bcaf525b00f2a27a3bc018fed503c40b /Source/CursesDialog | |
parent | 807aa8e35382ab55120ccb1e6ae88523ad7ee5a3 (diff) | |
download | CMake-74b735dea8e2255c53f12afea5706ad443d64785.zip CMake-74b735dea8e2255c53f12afea5706ad443d64785.tar.gz CMake-74b735dea8e2255c53f12afea5706ad443d64785.tar.bz2 |
cmDocumentation: `char*[][2]` → `cmDocumentationEntry[N]`
Use fixed size arrays of `cmDocumentationEntry` items instead of
open arrays of two `char` pointers when describe program options
help screens.
Also, drop `const char*[][2]` overloads of methods of
`cmDocumentation` and `cmDocumentationSection` classes in the sake
of generic (template) appenders introduced earlier.
Diffstat (limited to 'Source/CursesDialog')
-rw-r--r-- | Source/CursesDialog/ccmake.cxx | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/Source/CursesDialog/ccmake.cxx b/Source/CursesDialog/ccmake.cxx index 2986265..d61954a 100644 --- a/Source/CursesDialog/ccmake.cxx +++ b/Source/CursesDialog/ccmake.cxx @@ -16,7 +16,7 @@ #include "cmCursesMainForm.h" #include "cmCursesStandardIncludes.h" #include "cmDocumentation.h" -#include "cmDocumentationEntry.h" // IWYU pragma: keep +#include "cmDocumentationEntry.h" #include "cmMessageMetadata.h" #include "cmState.h" #include "cmStringAlgorithms.h" @@ -24,12 +24,11 @@ #include "cmake.h" namespace { -const char* cmDocumentationName[][2] = { - { nullptr, " ccmake - Curses Interface for CMake." }, - { nullptr, nullptr } +const cmDocumentationEntry cmDocumentationName = { + nullptr, " ccmake - Curses Interface for CMake." }; -const char* cmDocumentationUsage[][2] = { +const cmDocumentationEntry cmDocumentationUsage[2] = { { nullptr, " ccmake <path-to-source>\n" " ccmake <path-to-existing-build>" }, @@ -37,17 +36,12 @@ const char* cmDocumentationUsage[][2] = { "Specify a source directory to (re-)generate a build system for " "it in the current working directory. Specify an existing build " "directory to re-generate its build system." }, - { nullptr, nullptr } }; -const char* cmDocumentationUsageNote[][2] = { - { nullptr, "Run 'ccmake --help' for more information." }, - { nullptr, nullptr } +const cmDocumentationEntry cmDocumentationUsageNote = { + nullptr, "Run 'ccmake --help' for more information." }; -const char* cmDocumentationOptions[][2] = { CMAKE_STANDARD_OPTIONS_TABLE, - { nullptr, nullptr } }; - #ifndef _WIN32 extern "C" { @@ -89,8 +83,8 @@ int main(int argc, char const* const* argv) doc.AppendSection("Usage", cmDocumentationUsageNote); } doc.AppendSection("Generators", generators); - doc.PrependSection("Options", cmDocumentationOptions); - return doc.PrintRequestedDocumentation(std::cout) ? 0 : 1; + doc.PrependSection("Options", cmake::CMAKE_STANDARD_OPTIONS_TABLE); + return !doc.PrintRequestedDocumentation(std::cout); } bool debug = false; |