summaryrefslogtreecommitdiffstats
path: root/Source/cmDocumentation.cxx
diff options
context:
space:
mode:
authorAlexander Neundorf <neundorf@kde.org>2007-06-28 19:04:28 (GMT)
committerAlexander Neundorf <neundorf@kde.org>2007-06-28 19:04:28 (GMT)
commit151d55557eb823a4ee6d66bdc0a2ea49868bfc1a (patch)
treefe96c973cfc43dbaec4056a93034c6def1d8077a /Source/cmDocumentation.cxx
parent95f55515fa6064d862354524d0837a9ba4787f49 (diff)
downloadCMake-151d55557eb823a4ee6d66bdc0a2ea49868bfc1a.zip
CMake-151d55557eb823a4ee6d66bdc0a2ea49868bfc1a.tar.gz
CMake-151d55557eb823a4ee6d66bdc0a2ea49868bfc1a.tar.bz2
ENH: generate separate documentation for the commands, compatiblity
commands, modules and properties as html, text and man pages. The names of the man pages are cmcommands, cmcompat, cmprops and cmmodules, so they are easy to type. Alex
Diffstat (limited to 'Source/cmDocumentation.cxx')
-rw-r--r--Source/cmDocumentation.cxx107
1 files changed, 92 insertions, 15 deletions
diff --git a/Source/cmDocumentation.cxx b/Source/cmDocumentation.cxx
index 90deae6..3568aef 100644
--- a/Source/cmDocumentation.cxx
+++ b/Source/cmDocumentation.cxx
@@ -305,14 +305,28 @@ bool cmDocumentation::PrintDocumentation(Type ht, std::ostream& os)
return this->PrintDocumentationSingleModule(os);
case cmDocumentation::SingleProperty:
return this->PrintDocumentationSingleProperty(os);
- case cmDocumentation::List: return this->PrintDocumentationList(os);
- case cmDocumentation::ModuleList: return this->PrintModuleList(os);
- case cmDocumentation::PropertyList: return this->PrintPropertyList(os);
-
- case cmDocumentation::Full: return this->PrintDocumentationFull(os);
-
- case cmDocumentation::Copyright: return this->PrintCopyright(os);
- case cmDocumentation::Version: return true;
+ case cmDocumentation::List:
+ return this->PrintDocumentationList(os);
+ case cmDocumentation::ModuleList:
+ return this->PrintModuleList(os);
+ case cmDocumentation::PropertyList:
+ return this->PrintPropertyList(os);
+
+ case cmDocumentation::Full:
+ return this->PrintDocumentationFull(os);
+ case cmDocumentation::Modules:
+ return this->PrintDocumentationModules(os);
+ case cmDocumentation::Properties:
+ return this->PrintDocumentationProperties(os);
+ case cmDocumentation::Commands:
+ return this->PrintDocumentationCurrentCommands(os);
+ case cmDocumentation::CompatCommands:
+ return this->PrintDocumentationCompatCommands(os);
+
+ case cmDocumentation::Copyright:
+ return this->PrintCopyright(os);
+ case cmDocumentation::Version:
+ return true;
default: return false;
}
}
@@ -549,6 +563,30 @@ bool cmDocumentation::CheckOptions(int argc, const char* const* argv)
help.Type = cmDocumentation::Single;
}
}
+ else if(strcmp(argv[i], "--help-properties") == 0)
+ {
+ help.Type = cmDocumentation::Properties;
+ GET_OPT_FILENAME(help.Filename);
+ help.Form = this->GetFormFromFilename(help.Filename);
+ }
+ else if(strcmp(argv[i], "--help-modules") == 0)
+ {
+ help.Type = cmDocumentation::Modules;
+ GET_OPT_FILENAME(help.Filename);
+ help.Form = this->GetFormFromFilename(help.Filename);
+ }
+ else if(strcmp(argv[i], "--help-commands") == 0)
+ {
+ help.Type = cmDocumentation::Commands;
+ GET_OPT_FILENAME(help.Filename);
+ help.Form = this->GetFormFromFilename(help.Filename);
+ }
+ else if(strcmp(argv[i], "--help-compatcommands") == 0)
+ {
+ help.Type = cmDocumentation::CompatCommands;
+ GET_OPT_FILENAME(help.Filename);
+ help.Form = this->GetFormFromFilename(help.Filename);
+ }
else if(strcmp(argv[i], "--help-full") == 0)
{
help.Type = cmDocumentation::Full;
@@ -1388,6 +1426,46 @@ bool cmDocumentation::PrintDocumentationFull(std::ostream& os)
}
//----------------------------------------------------------------------------
+bool cmDocumentation::PrintDocumentationModules(std::ostream& os)
+{
+ this->CreateModulesDocumentation();
+ this->PrintHeader(GetNameString(), os);
+ this->Print(os);
+ this->PrintFooter(os);
+ return true;
+}
+
+//----------------------------------------------------------------------------
+bool cmDocumentation::PrintDocumentationProperties(std::ostream& os)
+{
+ this->CreatePropertiesDocumentation();
+ this->PrintHeader(GetNameString(), os);
+ this->Print(os);
+ this->PrintFooter(os);
+ return true;
+}
+
+//----------------------------------------------------------------------------
+bool cmDocumentation::PrintDocumentationCurrentCommands(std::ostream& os)
+{
+ this->CreateCurrentCommandsDocumentation();
+ this->PrintHeader(GetNameString(), os);
+ this->Print(os);
+ this->PrintFooter(os);
+ return true;
+}
+
+//----------------------------------------------------------------------------
+bool cmDocumentation::PrintDocumentationCompatCommands(std::ostream& os)
+{
+ this->CreateCompatCommandsDocumentation();
+ this->PrintHeader(GetNameString(), os);
+ this->Print(os);
+ this->PrintFooter(os);
+ return true;
+}
+
+//----------------------------------------------------------------------------
void cmDocumentation::PrintHeader(const char* name, std::ostream& os)
{
switch(this->CurrentForm)
@@ -1476,19 +1554,17 @@ void cmDocumentation::CreateFullDocumentation()
}
}
-void cmDocumentation::CreateCurrentCommandDocumentation()
+void cmDocumentation::CreateCurrentCommandsDocumentation()
{
this->ClearSections();
- this->AddSection(this->DescriptionSection.GetName(CurrentForm),
- cmCompatCommandsDocumentationDescription);
- this->AddSection(this->CompatCommandsSection);
+ this->AddSection(this->CommandsSection);
this->AddSection(this->CopyrightSection.GetName(CurrentForm),
cmDocumentationCopyright);
this->AddSection(this->SeeAlsoSection.GetName(CurrentForm),
cmDocumentationStandardSeeAlso);
}
-void cmDocumentation::CreateCompatCommandDocumentation()
+void cmDocumentation::CreateCompatCommandsDocumentation()
{
this->ClearSections();
this->AddSection(this->DescriptionSection.GetName(CurrentForm),
@@ -1502,8 +1578,9 @@ void cmDocumentation::CreateCompatCommandDocumentation()
//----------------------------------------------------------------------------
void cmDocumentation::CreateModulesDocumentation()
- {
- this->ClearSections();
+{
+ this->ClearSections();
+ this->CreateModulesSection();
this->AddSection(this->DescriptionSection.GetName(CurrentForm),
cmModulesDocumentationDescription);
this->AddSection(this->ModulesSection);