ENH: Running with zero arguments now produces usage.

This commit is contained in:
Brad King 2003-04-02 22:44:42 -05:00
parent 5ebcb51fb4
commit 3bba5f587e

View File

@ -172,6 +172,13 @@ void cmDocumentation::PrintDocumentation(Type ht, std::ostream& os)
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
cmDocumentation::Type cmDocumentation::CheckOptions(int argc, char** argv) cmDocumentation::Type cmDocumentation::CheckOptions(int argc, char** argv)
{ {
// Providing zero arguments gives usage information.
if(argc == 1)
{
return cmDocumentation::Usage;
}
// Search for supported help options.
for(int i=1; i < argc; ++i) for(int i=1; i < argc; ++i)
{ {
if((strcmp(argv[i], "-help") == 0) || if((strcmp(argv[i], "-help") == 0) ||
@ -402,9 +409,9 @@ void cmDocumentation::PrintSectionUsage(std::ostream& os,
os << "\n"; os << "\n";
this->TextIndent = ""; this->TextIndent = "";
this->PrintFormatted(os, op->brief); this->PrintFormatted(os, op->brief);
os << "\n";
} }
} }
os << "\n";
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------