summaryrefslogtreecommitdiffstats
path: root/Source/cmDocumentation.cxx
diff options
context:
space:
mode:
authorAdam Strzelecki <ono@java.pl>2014-06-12 20:18:32 (GMT)
committerBrad King <brad.king@kitware.com>2014-06-13 12:36:43 (GMT)
commitde7c2882ff053ebdb60c57caa4f0cef87161fede (patch)
treec9cbe14bf60b1507d04042fc892625cd3f0aaa89 /Source/cmDocumentation.cxx
parent1f00d738bde27a55531d27ba311d977fb9c59539 (diff)
downloadCMake-de7c2882ff053ebdb60c57caa4f0cef87161fede.zip
CMake-de7c2882ff053ebdb60c57caa4f0cef87161fede.tar.gz
CMake-de7c2882ff053ebdb60c57caa4f0cef87161fede.tar.bz2
cmake,ccmake: Produce shorter output on no arguments (#14973)
Instead printing complete help cmake/ccmake now prints only Usage section and extra information how to get more help or start your build. Implementation Details: Usage help type was renamed to Help, and new Usage was introduces that prints only command line usage information without any extra details. Commands add some extra information when no arguments are passed.
Diffstat (limited to 'Source/cmDocumentation.cxx')
-rw-r--r--Source/cmDocumentation.cxx20
1 files changed, 17 insertions, 3 deletions
diff --git a/Source/cmDocumentation.cxx b/Source/cmDocumentation.cxx
index 8d035af..3ff1017 100644
--- a/Source/cmDocumentation.cxx
+++ b/Source/cmDocumentation.cxx
@@ -113,7 +113,9 @@ bool cmDocumentation::PrintDocumentation(Type ht, std::ostream& os)
switch (ht)
{
case cmDocumentation::Usage:
- return this->PrintDocumentationUsage(os);
+ return this->PrintUsage(os);
+ case cmDocumentation::Help:
+ return this->PrintHelp(os);
case cmDocumentation::Full:
return this->PrintHelpFull(os);
case cmDocumentation::OneManual:
@@ -300,7 +302,7 @@ bool cmDocumentation::CheckOptions(int argc, const char* const* argv,
(strcmp(argv[i], "-h") == 0) ||
(strcmp(argv[i], "-H") == 0))
{
- help.HelpType = cmDocumentation::Usage;
+ help.HelpType = cmDocumentation::Help;
GET_OPT_ARGUMENT(help.Argument);
help.Argument = cmSystemTools::LowerCase(help.Argument);
// special case for single command
@@ -841,7 +843,19 @@ bool cmDocumentation::PrintHelpListVariables(std::ostream& os)
}
//----------------------------------------------------------------------------
-bool cmDocumentation::PrintDocumentationUsage(std::ostream& os)
+bool cmDocumentation::PrintUsage(std::ostream& os)
+{
+ std::map<std::string,cmDocumentationSection*>::iterator si;
+ si = this->AllSections.find("Usage");
+ if(si != this->AllSections.end())
+ {
+ this->Formatter.PrintSection(os, *si->second);
+ }
+ return true;
+}
+
+//----------------------------------------------------------------------------
+bool cmDocumentation::PrintHelp(std::ostream& os)
{
std::map<std::string,cmDocumentationSection*>::iterator si;
si = this->AllSections.find("Usage");