BUG 9961: ctest --help should not display a Generators section

This commit is contained in:
Zach Mullen 2009-11-24 11:46:06 -05:00
parent bb18790397
commit 0ae0780055
3 changed files with 11 additions and 1 deletions

View File

@ -267,6 +267,8 @@ cmDocumentation::cmDocumentation()
this->VariableSections.push_back("Variables That Describe the System"); this->VariableSections.push_back("Variables That Describe the System");
this->VariableSections.push_back("Variables that Control the Build"); this->VariableSections.push_back("Variables that Control the Build");
this->VariableSections.push_back("Variables for Languages"); this->VariableSections.push_back("Variables for Languages");
this->ShowGenerators = true;
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
@ -1279,7 +1281,10 @@ bool cmDocumentation::PrintDocumentationUsage(std::ostream& os)
this->ClearSections(); this->ClearSections();
this->AddSectionToPrint("Usage"); this->AddSectionToPrint("Usage");
this->AddSectionToPrint("Options"); this->AddSectionToPrint("Options");
if(this->ShowGenerators)
{
this->AddSectionToPrint("Generators"); this->AddSectionToPrint("Generators");
}
this->Print(os); this->Print(os);
return true; return true;
} }

View File

@ -58,6 +58,8 @@ public:
/** Print help of the given type. */ /** Print help of the given type. */
bool PrintDocumentation(Type ht, std::ostream& os, const char* docname=0); bool PrintDocumentation(Type ht, std::ostream& os, const char* docname=0);
void SetShowGenerators(bool showGen) { this->ShowGenerators = showGen; }
/** Set the program name for standard document generation. */ /** Set the program name for standard document generation. */
void SetName(const char* name); void SetName(const char* name);
@ -159,6 +161,8 @@ private:
const char* GetDefaultDocName(Type ht) const; const char* GetDefaultDocName(Type ht) const;
bool IsOption(const char* arg) const; bool IsOption(const char* arg) const;
bool ShowGenerators;
std::string NameString; std::string NameString;
std::string DocName; std::string DocName;
std::map<std::string,cmDocumentationSection*> AllSections; std::map<std::string,cmDocumentationSection*> AllSections;

View File

@ -279,6 +279,7 @@ int main (int argc, char *argv[])
ch->CreateCMake(); ch->CreateCMake();
ch->GetCommandDocumentation(commands); ch->GetCommandDocumentation(commands);
doc.SetShowGenerators(false);
doc.SetName("ctest"); doc.SetName("ctest");
doc.SetSection("Name",cmDocumentationName); doc.SetSection("Name",cmDocumentationName);
doc.SetSection("Usage",cmDocumentationUsage); doc.SetSection("Usage",cmDocumentationUsage);