summaryrefslogtreecommitdiffstats
path: root/Source/cmDocumentation.cxx
diff options
context:
space:
mode:
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");