[cmake-commits] alex committed cmDocumentation.cxx 1.43 1.44 cmDocumentation.h 1.21 1.22 cmDumpDocumentation.cxx 1.15 1.16 cmakemain.cxx 1.58 1.59

cmake-commits at cmake.org cmake-commits at cmake.org
Thu Jun 28 11:00:59 EDT 2007


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

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

ENH: 
-in the full documentation there is now an extra section for
compatibility commands, so users see which commands they shouldn't use
-cmake -h <command> now also works with lower case commands
--help-fullm --help-command, --help-module and --help-property now determine
the output format from the extension of the given filename 

Let me know if there are some things I overlooked.

Alex


Index: cmDocumentation.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmDocumentation.cxx,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -d -r1.43 -r1.44
--- cmDocumentation.cxx	22 Jun 2007 12:44:51 -0000	1.43
+++ cmDocumentation.cxx	28 Jun 2007 15:00:57 -0000	1.44
@@ -20,6 +20,9 @@
 #include "cmVersion.h"
 #include <cmsys/Directory.hxx>
 
+
+const cmDocumentationEntry cmDocumentation::cmSection::EmptySection ={0,0,0};
+
 //----------------------------------------------------------------------------
 static const cmDocumentationEntry cmDocumentationStandardOptions[] =
 {
@@ -35,7 +38,7 @@
   {"--help-html [file]", "Print full help in HTML format.",
    "This option is used by CMake authors to help produce web pages.  "
    "If a file is specified, the help is written into it."},
-  {"--help-man [file]", "Print a UNIX man page and exit.",
+  {"--help-man [file]", "Print full help as a UNIX man page and exit.",
    "This option is used by the cmake build to generate the UNIX man page.  "
    "If a file is specified, the help is written into it."},
   {"--version [file]", "Show program name/version banner and exit.",
@@ -287,37 +290,13 @@
 //----------------------------------------------------------------------------
 bool cmDocumentation::PrintDocumentation(Type ht, std::ostream& os)
 {
-  if(ht != cmDocumentation::HTML && ht != cmDocumentation::Man)
+  if ((this->CurrentForm != HTMLForm) && (this->CurrentForm != ManForm))
     {
     this->PrintVersion(os);
     }
 
   switch (ht)
     {
-    case cmDocumentation::Full:
-    case cmDocumentation::Single:
-    case cmDocumentation::SingleModule:
-    case cmDocumentation::SingleProperty:
-    case cmDocumentation::List:
-    case cmDocumentation::ModuleList:
-    case cmDocumentation::PropertyList:
-      this->CurrentForm = TextForm;
-      break;
-
-    case cmDocumentation::HTML: this->CurrentForm = HTMLForm; break;
-    case cmDocumentation::Man: this->CurrentForm = ManForm; break;
-
-    case cmDocumentation::Usage:
-    case cmDocumentation::Copyright:
-    case cmDocumentation::Version:
-      this->CurrentForm = UsageForm;
-      break;
-    case cmDocumentation::None:
-      break;
-    }
-
-  switch (ht)
-    {
     case cmDocumentation::Usage:
       return this->PrintDocumentationUsage(os);
     case cmDocumentation::Single:
@@ -330,9 +309,7 @@
     case cmDocumentation::ModuleList: return this->PrintModuleList(os);
     case cmDocumentation::PropertyList: return this->PrintPropertyList(os);
 
-    case cmDocumentation::Full:
-    case cmDocumentation::HTML:
-    case cmDocumentation::Man: return this->PrintDocumentationFull(os);
+    case cmDocumentation::Full: return this->PrintDocumentationFull(os);
 
     case cmDocumentation::Copyright: return this->PrintCopyright(os);
     case cmDocumentation::Version:   return true;
@@ -463,38 +440,20 @@
   bool result = true;
   
   // Loop over requested documentation types.
-  for(RequestedMapType::const_iterator i = this->RequestedMap.begin();
-      i != this->RequestedMap.end(); ++i)
+  for(std::vector<RequestedHelpItem>::const_iterator 
+      i = this->RequestedHelpItems.begin();
+      i != this->RequestedHelpItems.end(); 
+      ++i)
     {
-    // Special case for printing help for a single command.
-    if(i->first == cmDocumentation::Usage && i->second.length() > 0 &&
-       !this->CommandsSection.IsEmpty())
-      {
-      // Check if the argument to the usage request was a command.
-      for(cmDocumentationEntry* entry = this->CommandsSection.GetEntries();
-          entry->brief; ++entry)
-        {
-        if(entry->name && (strcmp(entry->name, i->second.c_str()) == 0))
-          {
-          this->PrintDocumentationCommand(os, entry);
-          return true;
-          }
-        }
-      
-      // Argument was not a command.  Complain.
-      os << "Help argument \"" << i->second.c_str()
-         << "\" is not a CMake command.  "
-         << "Use --help-command-list to see all commands.\n";
-      return false;
-      }
-    
+    this->CurrentForm = i->Form;
+    this->CurrentArgument = i->Argument;
     // If a file name was given, use it.  Otherwise, default to the
     // given stream.
     std::ofstream* fout = 0;
     std::ostream* s = &os;
-    if(i->second.length() > 0)
+    if(i->Filename.length() > 0)
       {
-      fout = new std::ofstream(i->second.c_str(), std::ios::out);
+      fout = new std::ofstream(i->Filename.c_str(), std::ios::out);
       if(fout)
         {
         s = fout;
@@ -506,7 +465,7 @@
       }
     
     // Print this documentation type to the stream.
-    if(!this->PrintDocumentation(i->first, *s) || !*s)
+    if(!this->PrintDocumentation(i->Type, *s) || !*s)
       {
       result = false;
       }
@@ -520,22 +479,60 @@
   return result;
 }
 
+#define GET_OPT_COMMAND(target)                       \
+     if((i+1 < argc) && !this->IsOption(argv[i+1]))   \
+        {                                             \
+        target = cmSystemTools::UpperCase(argv[i+1]); \
+        i = i+1;                                      \
+        };
+
+#define GET_OPT_FILENAME(target)                      \
+     if((i+1 < argc) && !this->IsOption(argv[i+1]))   \
+        {                                             \
+        target = argv[i+1];                           \
+        i = i+1;                                      \
+        };
+
+
+cmDocumentation::Form cmDocumentation::GetFormFromFilename(
+                                                   const std::string& filename)
+{
+  std::string ext = cmSystemTools::GetFilenameExtension(filename);
+  ext = cmSystemTools::UpperCase(ext);
+  if ((ext == ".HTM") || (ext == ".HTML"))
+    {
+    return cmDocumentation::HTMLForm;
+    }
+
+  // ".1" to ".9" should be manpages
+  if ((ext.length()==2) && (ext[1] >='1') && (ext[1]<='9'))
+    {
+    return cmDocumentation::ManForm;
+    }
+
+  return cmDocumentation::TextForm;
+}
+
 //----------------------------------------------------------------------------
 bool cmDocumentation::CheckOptions(int argc, const char* const* argv)
 {
   // Providing zero arguments gives usage information.
   if(argc == 1)
     {
-    this->RequestedMap[cmDocumentation::Usage] = "";
+    RequestedHelpItem help;
+    help.Type = cmDocumentation::Usage;
+    help.Form = cmDocumentation::UsageForm;
+    this->RequestedHelpItems.push_back(help);
     return true;
     }
-  
+
   // Search for supported help options.
+
   bool result = false;
   for(int i=1; i < argc; ++i)
     {
+    RequestedHelpItem help;
     // Check if this is a supported help option.
-    Type type = cmDocumentation::None;
     if((strcmp(argv[i], "-help") == 0) ||
        (strcmp(argv[i], "--help") == 0) ||
        (strcmp(argv[i], "/?") == 0) ||
@@ -543,83 +540,91 @@
        (strcmp(argv[i], "-h") == 0) ||
        (strcmp(argv[i], "-H") == 0))
       {
-      type = cmDocumentation::Usage;
+      help.Type = cmDocumentation::Usage;
+      help.Form = cmDocumentation::UsageForm;
+      GET_OPT_COMMAND(help.Argument);
+      // special case for single command
+      if (!help.Argument.empty())
+        {
+        help.Type = cmDocumentation::Single;
+        }
       }
     else if(strcmp(argv[i], "--help-full") == 0)
       {
-      type = cmDocumentation::Full;
+      help.Type = cmDocumentation::Full;
+      GET_OPT_FILENAME(help.Filename);
+      help.Form = this->GetFormFromFilename(help.Filename);
       }
     else if(strcmp(argv[i], "--help-html") == 0)
       {
-      type = cmDocumentation::HTML;
+      help.Type = cmDocumentation::Full;
+      GET_OPT_FILENAME(help.Filename);
+      help.Form = cmDocumentation::HTMLForm;
       }
     else if(strcmp(argv[i], "--help-man") == 0)
       {
-      type = cmDocumentation::Man;
+      help.Type = cmDocumentation::Full;
+      GET_OPT_FILENAME(help.Filename);
+      help.Form = cmDocumentation::ManForm;
       }
     else if(strcmp(argv[i], "--help-command") == 0)
       {
-      type = cmDocumentation::Single;
-      if((i+1 < argc) && !this->IsOption(argv[i+1]))
-        {
-        this->SingleCommand = argv[i+1];
-        this->SingleCommand = cmSystemTools::UpperCase(this->SingleCommand);
-        i = i+1;
-        }
+      help.Type = cmDocumentation::Single;
+      GET_OPT_COMMAND(help.Argument);
+      GET_OPT_FILENAME(help.Filename);
+      help.Form = this->GetFormFromFilename(help.Filename);
       }
     else if(strcmp(argv[i], "--help-module") == 0)
       {
-      type = cmDocumentation::SingleModule;
-      if((i+1 < argc) && !this->IsOption(argv[i+1]))
-        {
-        this->SingleModuleName = argv[i+1];
-        i = i+1;
-        }
+      help.Type = cmDocumentation::SingleModule;
+      GET_OPT_COMMAND(help.Argument);
+      GET_OPT_FILENAME(help.Filename);
+      help.Form = this->GetFormFromFilename(help.Filename);
       }
     else if(strcmp(argv[i], "--help-property") == 0)
       {
-      type = cmDocumentation::SingleProperty;
-      if((i+1 < argc) && !this->IsOption(argv[i+1]))
-        {
-        this->SinglePropertyName = argv[i+1];
-        i = i+1;
-        }
+      help.Type = cmDocumentation::SingleProperty;
+      GET_OPT_COMMAND(help.Argument);
+      GET_OPT_FILENAME(help.Filename);
+      help.Form = this->GetFormFromFilename(help.Filename);
       }
     else if(strcmp(argv[i], "--help-command-list") == 0)
       {
-      type = cmDocumentation::List;
+      help.Type = cmDocumentation::List;
+      GET_OPT_FILENAME(help.Filename);
+      help.Form = cmDocumentation::TextForm;
       }
     else if(strcmp(argv[i], "--help-module-list") == 0)
       {
-      type = cmDocumentation::ModuleList;
+      help.Type = cmDocumentation::ModuleList;
+      GET_OPT_FILENAME(help.Filename);
+      help.Form = cmDocumentation::TextForm;
       }
     else if(strcmp(argv[i], "--help-property-list") == 0)
       {
-      type = cmDocumentation::PropertyList;
+      help.Type = cmDocumentation::PropertyList;
+      GET_OPT_FILENAME(help.Filename);
+      help.Form = cmDocumentation::TextForm;
       }
     else if(strcmp(argv[i], "--copyright") == 0)
       {
-      type = cmDocumentation::Copyright;
+      help.Type = cmDocumentation::Copyright;
+      GET_OPT_FILENAME(help.Filename);
+      help.Form = cmDocumentation::UsageForm;
       }
     else if((strcmp(argv[i], "--version") == 0) || 
             (strcmp(argv[i], "-version") == 0) || 
             (strcmp(argv[i], "/V") == 0))
       {
-      type = cmDocumentation::Version;
+      help.Type = cmDocumentation::Version;
+      GET_OPT_FILENAME(help.Filename);
+      help.Form = cmDocumentation::UsageForm;
       }
-    if(type)
+    if(help.Type != None)
       {
       // This is a help option.  See if there is a file name given.
       result = true;
-      if((i+1 < argc) && !this->IsOption(argv[i+1]))
-        {
-        this->RequestedMap[type] = argv[i+1];
-        i = i+1;
-        }
-      else
-        {
-        this->RequestedMap[type] = "";
-        }
+      this->RequestedHelpItems.push_back(help);
       }
     }
   return result;
@@ -1206,24 +1211,26 @@
     os << "Internal error: commands list is empty." << std::endl;
     return false;
     }
-  if(this->SingleCommand.length() == 0)
+  if(this->CurrentArgument.length() == 0)
     {
     os << "Argument --help-command needs a command name.\n";
     return false;
     }
-  for(cmDocumentationEntry* entry = this->CommandsSection.GetEntries();
+  for(const cmDocumentationEntry* entry = this->CommandsSection.GetEntries();
       entry->brief; ++entry)
     {
-    if(entry->name && this->SingleCommand == entry->name)
+    if(entry->name && this->CurrentArgument == entry->name)
       {
       this->PrintDocumentationCommand(os, entry);
       return true;
       }
     }
-  for(cmDocumentationEntry* entry = this->CompatCommandsSection.GetEntries();
-      entry->brief; ++entry)
+  for(const cmDocumentationEntry* 
+      entry = this->CompatCommandsSection.GetEntries();
+      entry->brief; 
+      ++entry)
     {
-    if(entry->name && this->SingleCommand == entry->name)
+    if(entry->name && this->CurrentArgument == entry->name)
       {
       this->PrintDocumentationCommand(os, entry);
       return true;
@@ -1231,7 +1238,7 @@
     }
 
   // Argument was not a command.  Complain.
-  os << "Argument \"" << this->SingleCommand.c_str()
+  os << "Argument \"" << this->CurrentArgument.c_str()
      << "\" to --help-command is not a CMake command.  "
      << "Use --help-command-list to see all commands.\n";
   return false;
@@ -1240,18 +1247,18 @@
 //----------------------------------------------------------------------------
 bool cmDocumentation::PrintDocumentationSingleModule(std::ostream& os)
 {
-  if(this->SingleModuleName.length() == 0)
+  if(this->CurrentArgument.length() == 0)
     {
     os << "Argument --help-module needs a module name.\n";
     return false;
     }
   std::string cmakeModules = this->CMakeRoot;
   cmakeModules += "/Modules/";
-  cmakeModules += this->SingleModuleName;
+  cmakeModules += this->CurrentArgument;
   cmakeModules += ".cmake";
   if(cmSystemTools::FileExists(cmakeModules.c_str())
      && this->CreateSingleModule(cmakeModules.c_str(), 
-                                 this->SingleModuleName.c_str()))
+                                 this->CurrentArgument.c_str()))
     {
     this->PrintDocumentationCommand(os, this->ModulesSection.GetEntries());
     os <<  "\n       Defined in: ";
@@ -1259,7 +1266,7 @@
     return true;
     }
   // Argument was not a module.  Complain.
-  os << "Argument \"" << this->SingleModuleName.c_str()
+  os << "Argument \"" << this->CurrentArgument.c_str()
      << "\" to --help-module is not a CMake module.";
   return false;
 }
@@ -1272,22 +1279,22 @@
     os << "Internal error: properties list is empty." << std::endl;
     return false;
     }
-  if(this->SinglePropertyName.length() == 0)
+  if(this->CurrentArgument.length() == 0)
     {
     os << "Argument --help-property needs a property name.\n";
     return false;
     }
-  for(cmDocumentationEntry* entry = this->PropertiesSection.GetEntries();
+  for(const cmDocumentationEntry* entry = this->PropertiesSection.GetEntries();
       entry->brief; ++entry)
     {
-    if(entry->name && this->SinglePropertyName == entry->name)
+    if(entry->name && this->CurrentArgument == entry->name)
       {
       this->PrintDocumentationCommand(os, entry);
       return true;
       }
     }
   // Argument was not a command.  Complain.
-  os << "Argument \"" << this->SinglePropertyName.c_str()
+  os << "Argument \"" << this->CurrentArgument.c_str()
      << "\" to --help-property is not a CMake property.  "
      << "Use --help-property-list to see all properties.\n";
   return false;
@@ -1301,7 +1308,7 @@
     os << "Internal error: commands list is empty." << std::endl;
     return false;
     }
-  for(cmDocumentationEntry* entry = this->CommandsSection.GetEntries();
+  for(const cmDocumentationEntry* entry = this->CommandsSection.GetEntries();
       entry->brief; ++entry)
     {
     if(entry->name)
@@ -1309,6 +1316,17 @@
       os << entry->name << std::endl;
       }
     }
+  os << "\nCompatibility commands:" << std::endl;
+  for(const cmDocumentationEntry* 
+      entry = this->CompatCommandsSection.GetEntries();
+      entry->brief; 
+      ++entry)
+    {
+    if(entry->name)
+      {
+      os << entry->name << std::endl;
+      }
+    }
   return true;
 }
 
@@ -1320,7 +1338,7 @@
     os << "Internal error: properties list is empty." << std::endl;
     return false;
     }
-  for(cmDocumentationEntry* entry = this->PropertiesSection.GetEntries();
+  for(const cmDocumentationEntry* entry = this->PropertiesSection.GetEntries();
       entry->brief; ++entry)
     {
     if(entry->name)
@@ -1340,7 +1358,7 @@
     os << "Internal error: modules list is empty." << std::endl;
     return false;
     }
-  for(cmDocumentationEntry* entry = this->ModulesSection.GetEntries();
+  for(const cmDocumentationEntry* entry = this->ModulesSection.GetEntries();
       entry->brief; ++entry)
     {
     if(entry->name)
@@ -1407,7 +1425,7 @@
 
 //----------------------------------------------------------------------------
 void cmDocumentation::PrintDocumentationCommand(std::ostream& os,
-                                                cmDocumentationEntry* entry)
+                                             const cmDocumentationEntry* entry)
 {
   cmDocumentationEntry singleCommandSection[3] =
     {
@@ -1461,39 +1479,51 @@
 void cmDocumentation::CreateCurrentCommandDocumentation()
 {
   this->ClearSections();
-  this->AddSection(this->DescriptionSection.GetName(CurrentForm), cmCompatCommandsDocumentationDescription);
+  this->AddSection(this->DescriptionSection.GetName(CurrentForm), 
+                   cmCompatCommandsDocumentationDescription);
   this->AddSection(this->CompatCommandsSection);
-  this->AddSection(this->CopyrightSection.GetName(CurrentForm), cmDocumentationCopyright);
-  this->AddSection(this->SeeAlsoSection.GetName(CurrentForm), cmDocumentationStandardSeeAlso);
+  this->AddSection(this->CopyrightSection.GetName(CurrentForm), 
+                   cmDocumentationCopyright);
+  this->AddSection(this->SeeAlsoSection.GetName(CurrentForm), 
+                   cmDocumentationStandardSeeAlso);
 }
 
 void cmDocumentation::CreateCompatCommandDocumentation()
 {
   this->ClearSections();
-  this->AddSection(this->DescriptionSection.GetName(CurrentForm), cmCompatCommandsDocumentationDescription);
+  this->AddSection(this->DescriptionSection.GetName(CurrentForm), 
+                   cmCompatCommandsDocumentationDescription);
   this->AddSection(this->CompatCommandsSection);
-  this->AddSection(this->CopyrightSection.GetName(CurrentForm), cmDocumentationCopyright);
-  this->AddSection(this->SeeAlsoSection.GetName(CurrentForm), cmDocumentationStandardSeeAlso);
+  this->AddSection(this->CopyrightSection.GetName(CurrentForm), 
+                   cmDocumentationCopyright);
+  this->AddSection(this->SeeAlsoSection.GetName(CurrentForm), 
+                   cmDocumentationStandardSeeAlso);
 }
 
 //----------------------------------------------------------------------------
 void cmDocumentation::CreateModulesDocumentation()
  {
    this->ClearSections();
-  this->AddSection(this->DescriptionSection.GetName(CurrentForm), cmModulesDocumentationDescription);
+  this->AddSection(this->DescriptionSection.GetName(CurrentForm), 
+                   cmModulesDocumentationDescription);
   this->AddSection(this->ModulesSection);
-  this->AddSection(this->CopyrightSection.GetName(CurrentForm), cmDocumentationCopyright);
-  this->AddSection(this->SeeAlsoSection.GetName(CurrentForm), cmDocumentationStandardSeeAlso);
+  this->AddSection(this->CopyrightSection.GetName(CurrentForm), 
+                   cmDocumentationCopyright);
+  this->AddSection(this->SeeAlsoSection.GetName(CurrentForm), 
+                   cmDocumentationStandardSeeAlso);
 }
 
 //----------------------------------------------------------------------------
 void cmDocumentation::CreatePropertiesDocumentation()
 {
   this->ClearSections();
-  this->AddSection(this->DescriptionSection.GetName(CurrentForm), cmPropertiesDocumentationDescription);
+  this->AddSection(this->DescriptionSection.GetName(CurrentForm), 
+                   cmPropertiesDocumentationDescription);
   this->AddSection(this->PropertiesSection);
-  this->AddSection(this->CopyrightSection.GetName(CurrentForm), cmDocumentationCopyright);
-  this->AddSection(this->SeeAlsoSection.GetName(CurrentForm), cmDocumentationStandardSeeAlso);
+  this->AddSection(this->CopyrightSection.GetName(CurrentForm), 
+                   cmDocumentationCopyright);
+  this->AddSection(this->SeeAlsoSection.GetName(CurrentForm), 
+                   cmDocumentationStandardSeeAlso);
 }
 
 //----------------------------------------------------------------------------

Index: cmDocumentation.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmDocumentation.h,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- cmDocumentation.h	22 Jun 2007 12:44:51 -0000	1.21
+++ cmDocumentation.h	28 Jun 2007 15:00:57 -0000	1.22
@@ -31,7 +31,7 @@
   /** Types of help provided.  */
   enum Type { None, Usage, Single, SingleModule, SingleProperty,
               List, ModuleList, PropertyList,
-              Full, HTML, Man, Copyright, Version };
+              Full, Copyright, Version };
   
   /**
    * Check command line arguments for documentation options.  Returns
@@ -113,12 +113,8 @@
         { return (form==ManForm?this->ManName.c_str():this->Name.c_str()); }
 
       /** Return a pointer to the first entry of this section. */
-      cmDocumentationEntry *GetEntries()
-        { return &this->Entries[0]; }
-
-      /** Return a pointer to the first entry of this section. */
       const cmDocumentationEntry *GetEntries() const
-        { return &this->Entries[0]; }
+        { return this->Entries.empty()?&this->EmptySection:&this->Entries[0];}
 
       /** Append an entry to this section. */
       void Append(const cmDocumentationEntry& entry)
@@ -133,6 +129,8 @@
       std::string Name;
       std::string ManName;
       std::vector<cmDocumentationEntry> Entries;
+      static const cmDocumentationEntry EmptySection;
+
   };
 
   /**
@@ -162,6 +160,9 @@
   
   /** Set cmake root so we can find installed files */
   void SetCMakeRoot(const char* root)  { this->CMakeRoot = root;}
+  
+  static Form GetFormFromFilename(const std::string& filename);
+
 private:
   void PrintHeader(const char* title, std::ostream& os);
   void PrintFooter(std::ostream& os);
@@ -205,7 +206,7 @@
   bool PrintDocumentationUsage(std::ostream& os);
   bool PrintDocumentationFull(std::ostream& os);
   void PrintDocumentationCommand(std::ostream& os,
-                                 cmDocumentationEntry* entry);
+                                 const cmDocumentationEntry* entry);
   
   void CreateUsageDocumentation();
   void CreateFullDocumentation();
@@ -236,19 +237,25 @@
   cmSection AuthorSection;
 
   std::string SeeAlsoString;
-  std::string SingleCommand;
-  std::string SingleModuleName;
-  std::string SinglePropertyName;
   std::string CMakeRoot;
   std::vector< char* > ModuleStrings;
   std::vector< const char* > Names;
   std::vector< const cmDocumentationEntry* > Sections;
   Form CurrentForm;
+  std::string CurrentArgument;
   const char* TextIndent;
   int TextWidth;
-  
-  typedef std::map<Type, cmStdString> RequestedMapType;
-  RequestedMapType RequestedMap;
+
+  struct RequestedHelpItem
+  {
+    RequestedHelpItem():Form(TextForm), Type(None) {}
+    cmDocumentation::Form Form;
+    cmDocumentation::Type Type;
+    std::string Filename;
+    std::string Argument;
+  };
+
+  std::vector<RequestedHelpItem> RequestedHelpItems;
 };
 
 #endif

Index: cmakemain.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmakemain.cxx,v
retrieving revision 1.58
retrieving revision 1.59
diff -u -d -r1.58 -r1.59
--- cmakemain.cxx	14 Jun 2007 12:49:57 -0000	1.58
+++ cmakemain.cxx	28 Jun 2007 15:00:57 -0000	1.59
@@ -170,9 +170,11 @@
     hcm.AddCMakePaths(av[0]);
     doc.SetCMakeRoot(hcm.GetCacheDefinition("CMAKE_ROOT"));
     std::vector<cmDocumentationEntry> commands;
+    std::vector<cmDocumentationEntry> compatCommands;
     std::vector<cmDocumentationEntry> properties;
     std::vector<cmDocumentationEntry> generators;
-    hcm.GetCommandDocumentation(commands);
+    hcm.GetCommandDocumentation(commands, true, false);
+    hcm.GetCommandDocumentation(compatCommands, false, true);
     hcm.GetPropertiesDocumentation(properties);
     hcm.GetGeneratorDocumentation(generators);
     doc.SetName("cmake");
@@ -182,6 +184,7 @@
     doc.SetGeneratorsSection(&generators[0]);
     doc.SetOptionsSection(cmDocumentationOptions);
     doc.SetCommandsSection(&commands[0]);
+    doc.SetCompatCommandsSection(&compatCommands[0]);
     doc.SetPropertiesSection(&properties[0]);
     doc.SetSeeAlsoList(cmDocumentationSeeAlso);
     int result = doc.PrintRequestedDocumentation(std::cout)? 0:1;

Index: cmDumpDocumentation.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmDumpDocumentation.cxx,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- cmDumpDocumentation.cxx	10 May 2006 19:01:22 -0000	1.15
+++ cmDumpDocumentation.cxx	28 Jun 2007 15:00:57 -0000	1.16
@@ -96,8 +96,6 @@
   doc.SetGeneratorsSection(&generators[0]);
   doc.PrintDocumentation(cmDocumentation::Usage, out);
   doc.PrintDocumentation(cmDocumentation::Full, out);
-  doc.PrintDocumentation(cmDocumentation::HTML, out);
-  doc.PrintDocumentation(cmDocumentation::Man, out);
   return 0;
 }
 



More information about the Cmake-commits mailing list