diff options
-rw-r--r-- | Help/manual/OPTIONS_HELP.txt | 6 | ||||
-rw-r--r-- | Source/cmDocumentation.cxx | 14 | ||||
-rw-r--r-- | Source/cmDocumentation.h | 1 | ||||
-rw-r--r-- | Source/cmDocumentationFormatter.h | 2 | ||||
-rw-r--r-- | Utilities/Sphinx/CMakeLists.txt | 14 |
5 files changed, 33 insertions, 4 deletions
diff --git a/Help/manual/OPTIONS_HELP.txt b/Help/manual/OPTIONS_HELP.txt index 631dfef..feeca7d 100644 --- a/Help/manual/OPTIONS_HELP.txt +++ b/Help/manual/OPTIONS_HELP.txt @@ -11,6 +11,12 @@ If a file is specified, the version is written into it. |file| +``--help-full [<f>]`` + Print all help manuals and exit. + + All manuals are printed in a human-readable text format. + |file| + ``--help-manual <man> [<f>]`` Print one help manual and exit. diff --git a/Source/cmDocumentation.cxx b/Source/cmDocumentation.cxx index 9c27fc1..5be4d5c 100644 --- a/Source/cmDocumentation.cxx +++ b/Source/cmDocumentation.cxx @@ -30,6 +30,8 @@ static const char *cmDocumentationStandardOptions[][2] = "Print usage information and exit."}, {"--version,-version,/V [<f>]", "Print version number and exit."}, + {"--help-full [<f>]", + "Print all help manuals and exit."}, {"--help-manual <man> [<f>]", "Print one help manual and exit."}, {"--help-manual-list [<f>]", @@ -112,6 +114,8 @@ bool cmDocumentation::PrintDocumentation(Type ht, std::ostream& os) { case cmDocumentation::Usage: return this->PrintDocumentationUsage(os); + case cmDocumentation::Full: + return this->PrintHelpFull(os); case cmDocumentation::OneManual: return this->PrintHelpOneManual(os); case cmDocumentation::OneCommand: @@ -364,9 +368,9 @@ bool cmDocumentation::CheckOptions(int argc, const char* const* argv, } else if(strcmp(argv[i], "--help-full") == 0) { + help.HelpType = cmDocumentation::Full; GET_OPT_ARGUMENT(help.Filename); - cmSystemTools::Message("Warning: --help-full no longer supported"); - return true; + this->WarnFormFromFilename(help, result); } else if(strcmp(argv[i], "--help-html") == 0) { @@ -678,6 +682,12 @@ bool cmDocumentation::PrintFiles(std::ostream& os, } //---------------------------------------------------------------------------- +bool cmDocumentation::PrintHelpFull(std::ostream& os) +{ + return this->PrintFiles(os, "index"); +} + +//---------------------------------------------------------------------------- bool cmDocumentation::PrintHelpOneManual(std::ostream& os) { std::string mname = this->CurrentArgument; diff --git a/Source/cmDocumentation.h b/Source/cmDocumentation.h index d5a7dd5..cc16eb7 100644 --- a/Source/cmDocumentation.h +++ b/Source/cmDocumentation.h @@ -102,6 +102,7 @@ private: bool PrintFiles(std::ostream& os, std::string const& pattern); bool PrintVersion(std::ostream& os); + bool PrintHelpFull(std::ostream& os); bool PrintHelpOneManual(std::ostream& os); bool PrintHelpOneCommand(std::ostream& os); bool PrintHelpOneModule(std::ostream& os); diff --git a/Source/cmDocumentationFormatter.h b/Source/cmDocumentationFormatter.h index 118f03d..61766b9 100644 --- a/Source/cmDocumentationFormatter.h +++ b/Source/cmDocumentationFormatter.h @@ -26,7 +26,7 @@ public: /** Types of help provided. */ enum Type { - None, Version, Usage, ListManuals, + None, Version, Usage, Full, ListManuals, ListCommands, ListModules, ListProperties, ListVariables, ListPolicies, OneManual, OneCommand, OneModule, OneProperty, OneVariable, OnePolicy, OldCustomModules diff --git a/Utilities/Sphinx/CMakeLists.txt b/Utilities/Sphinx/CMakeLists.txt index 23dc6ae..5e3e04b 100644 --- a/Utilities/Sphinx/CMakeLists.txt +++ b/Utilities/Sphinx/CMakeLists.txt @@ -24,6 +24,7 @@ project(CMakeHelp NONE) option(SPHINX_MAN "Build man pages with Sphinx" OFF) option(SPHINX_HTML "Build html help with Sphinx" OFF) +option(SPHINX_SINGLEHTML "Build html single page help with Sphinx" OFF) option(SPHINX_TEXT "Build text help with Sphinx (not installed)" OFF) find_program(SPHINX_EXECUTABLE NAMES sphinx-build @@ -32,7 +33,7 @@ find_program(SPHINX_EXECUTABLE mark_as_advanced(SPHINX_TEXT) -if(NOT SPHINX_MAN AND NOT SPHINX_HTML AND NOT SPHINX_TEXT) +if(NOT SPHINX_MAN AND NOT SPHINX_HTML AND NOT SPHINX_SINGLEHTML AND NOT SPHINX_TEXT) return() elseif(NOT SPHINX_EXECUTABLE) message(FATAL_ERROR "SPHINX_EXECUTABLE (sphinx-build) is not found!") @@ -60,6 +61,9 @@ endif() if(SPHINX_MAN) list(APPEND doc_formats man) endif() +if(SPHINX_SINGLEHTML) + list(APPEND doc_formats singlehtml) +endif() if(SPHINX_TEXT) list(APPEND doc_formats text) endif() @@ -122,3 +126,11 @@ if(SPHINX_HTML) PATTERN objects.inv EXCLUDE ) endif() + +if(SPHINX_SINGLEHTML) + install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/singlehtml + DESTINATION ${CMAKE_DOC_DIR} + PATTERN .buildinfo EXCLUDE + PATTERN objects.inv EXCLUDE + ) +endif() |