[cmake-commits] alex committed cmDocumentation.cxx 1.44 1.45 cmDocumentation.h 1.22 1.23 cmakemain.cxx 1.59 1.60

cmake-commits at cmake.org cmake-commits at cmake.org
Thu Jun 28 15:04:30 EDT 2007


Update of /cvsroot/CMake/CMake/Source
In directory public:/mounts/ram/cvs-serv27712/Source

Modified Files:
	cmDocumentation.cxx cmDocumentation.h cmakemain.cxx 
Log Message:

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


Index: cmDocumentation.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmDocumentation.cxx,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -d -r1.44 -r1.45
--- cmDocumentation.cxx	28 Jun 2007 15:00:57 -0000	1.44
+++ cmDocumentation.cxx	28 Jun 2007 19:04:28 -0000	1.45
@@ -305,14 +305,28 @@
       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::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::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;
+    case cmDocumentation::Copyright: 
+      return this->PrintCopyright(os);
+    case cmDocumentation::Version:   
+      return true;
     default: return false;
     }
 }
@@ -549,6 +563,30 @@
         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::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::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::CreateModulesDocumentation()
- {
-   this->ClearSections();
+{
+  this->ClearSections();
+  this->CreateModulesSection();
   this->AddSection(this->DescriptionSection.GetName(CurrentForm), 
                    cmModulesDocumentationDescription);
   this->AddSection(this->ModulesSection);

Index: cmDocumentation.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmDocumentation.h,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -d -r1.22 -r1.23
--- cmDocumentation.h	28 Jun 2007 15:00:57 -0000	1.22
+++ cmDocumentation.h	28 Jun 2007 19:04:28 -0000	1.23
@@ -31,7 +31,8 @@
   /** Types of help provided.  */
   enum Type { None, Usage, Single, SingleModule, SingleProperty,
               List, ModuleList, PropertyList,
-              Full, Copyright, Version };
+              Full, Properties, Modules, Commands, CompatCommands,
+              Copyright, Version };
   
   /**
    * Check command line arguments for documentation options.  Returns
@@ -205,13 +206,17 @@
   bool PrintDocumentationSingleProperty(std::ostream& os);
   bool PrintDocumentationUsage(std::ostream& os);
   bool PrintDocumentationFull(std::ostream& os);
+  bool PrintDocumentationModules(std::ostream& os);
+  bool PrintDocumentationProperties(std::ostream& os);
+  bool PrintDocumentationCurrentCommands(std::ostream& os);
+  bool PrintDocumentationCompatCommands(std::ostream& os);
   void PrintDocumentationCommand(std::ostream& os,
                                  const cmDocumentationEntry* entry);
   
   void CreateUsageDocumentation();
   void CreateFullDocumentation();
-  void CreateCurrentCommandDocumentation();
-  void CreateCompatCommandDocumentation();
+  void CreateCurrentCommandsDocumentation();
+  void CreateCompatCommandsDocumentation();
   void CreateModulesDocumentation();
   void CreatePropertiesDocumentation();
 

Index: cmakemain.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmakemain.cxx,v
retrieving revision 1.59
retrieving revision 1.60
diff -u -d -r1.59 -r1.60
--- cmakemain.cxx	28 Jun 2007 15:00:57 -0000	1.59
+++ cmakemain.cxx	28 Jun 2007 19:04:28 -0000	1.60
@@ -100,12 +100,18 @@
    "The list contains all commands for which help may be obtained by using "
    "the --help-command argument followed by a command name.  If a file is "
    "specified, the help is written into it."},
+  {"--help-commands [file]", "Print help for all commands and exit.",
+   "Full documentation specific for all current command is displayed."},
+  {"--help-compatcommands [file]", "Print help for compatibility commands. ",
+   "Full documentation specific for all compatibility commands is displayed."},
   {"--help-module module [file]", "Print help for a single module and exit.",
    "Full documentation specific to the given module is displayed."},
   {"--help-module-list [file]", "List available modules and exit.",
    "The list contains all modules for which help may be obtained by using "
    "the --help-module argument followed by a module name.  If a file is "
    "specified, the help is written into it."},
+  {"--help-modules [file]", "Print help for all modules and exit.",
+   "Full documentation for all modules is displayed."},
   {"--help-property prop [file]", 
    "Print help for a single property and exit.",
    "Full documentation specific to the given module is displayed."},
@@ -113,6 +119,8 @@
    "The list contains all properties for which help may be obtained by using "
    "the --help-property argument followed by a property name.  If a file is "
    "specified, the help is written into it."},
+  {"--help-properties [file]", "Print help for all properties and exit.",
+   "Full documentation for all properties is displayed."},
   {0,0,0}
 };
 



More information about the Cmake-commits mailing list