From 3bba5f587e719bed322e2d9aeca57283907b7ef9 Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 2 Apr 2003 22:44:42 -0500 Subject: [PATCH] ENH: Running with zero arguments now produces usage. --- Source/cmDocumentation.cxx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Source/cmDocumentation.cxx b/Source/cmDocumentation.cxx index 394c26313..121afc794 100644 --- a/Source/cmDocumentation.cxx +++ b/Source/cmDocumentation.cxx @@ -172,6 +172,13 @@ void cmDocumentation::PrintDocumentation(Type ht, std::ostream& os) //---------------------------------------------------------------------------- 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) { if((strcmp(argv[i], "-help") == 0) || @@ -402,9 +409,9 @@ void cmDocumentation::PrintSectionUsage(std::ostream& os, os << "\n"; this->TextIndent = ""; this->PrintFormatted(os, op->brief); - os << "\n"; } } + os << "\n"; } //----------------------------------------------------------------------------