diff options
author | Brad King <brad.king@kitware.com> | 2013-11-19 15:58:16 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2013-11-19 15:58:16 (GMT) |
commit | e7434d43abed59e52b068da1a9f5086ccadd998c (patch) | |
tree | 7ddfb44b301aa99af011e11fc8783faedfe85b96 | |
parent | 1da77bf1ee4f3ba315ebb00da2eaeac474614cad (diff) | |
download | CMake-e7434d43abed59e52b068da1a9f5086ccadd998c.zip CMake-e7434d43abed59e52b068da1a9f5086ccadd998c.tar.gz CMake-e7434d43abed59e52b068da1a9f5086ccadd998c.tar.bz2 |
cmDocumentation: Fix exit after help output format warnings
After warning that a help output format is no longer supported, fix the
return value from cmDocumentation::CheckOptions to indicate that it was
still a help option that was parsed. Otherwise CMake moves on to treat
the help output file name as a source tree and complains that it does
not exist.
-rw-r--r-- | Source/cmDocumentation.cxx | 27 | ||||
-rw-r--r-- | Source/cmDocumentation.h | 2 |
2 files changed, 16 insertions, 13 deletions
diff --git a/Source/cmDocumentation.cxx b/Source/cmDocumentation.cxx index 8029577..8e06a1c 100644 --- a/Source/cmDocumentation.cxx +++ b/Source/cmDocumentation.cxx @@ -195,24 +195,27 @@ bool cmDocumentation::PrintRequestedDocumentation(std::ostream& os) void cmDocumentation::WarnFormFromFilename( - cmDocumentation::RequestedHelpItem& request) + cmDocumentation::RequestedHelpItem& request, bool& result) { std::string ext = cmSystemTools::GetFilenameLastExtension(request.Filename); ext = cmSystemTools::UpperCase(ext); if ((ext == ".HTM") || (ext == ".HTML")) { request.HelpType = cmDocumentation::None; + result = true; cmSystemTools::Message("Warning: HTML help format no longer supported"); } else if (ext == ".DOCBOOK") { request.HelpType = cmDocumentation::None; + result = true; cmSystemTools::Message("Warning: Docbook help format no longer supported"); } // ".1" to ".9" should be manpages else if ((ext.length()==2) && (ext[1] >='1') && (ext[1]<='9')) { request.HelpType = cmDocumentation::None; + result = true; cmSystemTools::Message("Warning: Man help format no longer supported"); } } @@ -300,28 +303,28 @@ bool cmDocumentation::CheckOptions(int argc, const char* const* argv, help.HelpType = cmDocumentation::OneManual; help.Argument = "cmake-properties.7"; GET_OPT_ARGUMENT(help.Filename); - this->WarnFormFromFilename(help); + this->WarnFormFromFilename(help, result); } else if(strcmp(argv[i], "--help-policies") == 0) { help.HelpType = cmDocumentation::OneManual; help.Argument = "cmake-policies.7"; GET_OPT_ARGUMENT(help.Filename); - this->WarnFormFromFilename(help); + this->WarnFormFromFilename(help, result); } else if(strcmp(argv[i], "--help-variables") == 0) { help.HelpType = cmDocumentation::OneManual; help.Argument = "cmake-variables.7"; GET_OPT_ARGUMENT(help.Filename); - this->WarnFormFromFilename(help); + this->WarnFormFromFilename(help, result); } else if(strcmp(argv[i], "--help-modules") == 0) { help.HelpType = cmDocumentation::OneManual; help.Argument = "cmake-modules.7"; GET_OPT_ARGUMENT(help.Filename); - this->WarnFormFromFilename(help); + this->WarnFormFromFilename(help, result); } else if(strcmp(argv[i], "--help-custom-modules") == 0) { @@ -335,7 +338,7 @@ bool cmDocumentation::CheckOptions(int argc, const char* const* argv, help.HelpType = cmDocumentation::OneManual; help.Argument = "cmake-commands.7"; GET_OPT_ARGUMENT(help.Filename); - this->WarnFormFromFilename(help); + this->WarnFormFromFilename(help, result); } else if(strcmp(argv[i], "--help-compatcommands") == 0) { @@ -368,42 +371,42 @@ bool cmDocumentation::CheckOptions(int argc, const char* const* argv, GET_OPT_ARGUMENT(help.Argument); GET_OPT_ARGUMENT(help.Filename); help.Argument = cmSystemTools::LowerCase(help.Argument); - this->WarnFormFromFilename(help); + this->WarnFormFromFilename(help, result); } else if(strcmp(argv[i], "--help-module") == 0) { help.HelpType = cmDocumentation::OneModule; GET_OPT_ARGUMENT(help.Argument); GET_OPT_ARGUMENT(help.Filename); - this->WarnFormFromFilename(help); + this->WarnFormFromFilename(help, result); } else if(strcmp(argv[i], "--help-property") == 0) { help.HelpType = cmDocumentation::OneProperty; GET_OPT_ARGUMENT(help.Argument); GET_OPT_ARGUMENT(help.Filename); - this->WarnFormFromFilename(help); + this->WarnFormFromFilename(help, result); } else if(strcmp(argv[i], "--help-policy") == 0) { help.HelpType = cmDocumentation::OnePolicy; GET_OPT_ARGUMENT(help.Argument); GET_OPT_ARGUMENT(help.Filename); - this->WarnFormFromFilename(help); + this->WarnFormFromFilename(help, result); } else if(strcmp(argv[i], "--help-variable") == 0) { help.HelpType = cmDocumentation::OneVariable; GET_OPT_ARGUMENT(help.Argument); GET_OPT_ARGUMENT(help.Filename); - this->WarnFormFromFilename(help); + this->WarnFormFromFilename(help, result); } else if(strcmp(argv[i], "--help-manual") == 0) { help.HelpType = cmDocumentation::OneManual; GET_OPT_ARGUMENT(help.Argument); GET_OPT_ARGUMENT(help.Filename); - this->WarnFormFromFilename(help); + this->WarnFormFromFilename(help, result); } else if(strcmp(argv[i], "--help-command-list") == 0) { diff --git a/Source/cmDocumentation.h b/Source/cmDocumentation.h index 209cc27..05c0442 100644 --- a/Source/cmDocumentation.h +++ b/Source/cmDocumentation.h @@ -137,7 +137,7 @@ private: std::vector<RequestedHelpItem> RequestedHelpItems; cmDocumentationFormatter Formatter; - static void WarnFormFromFilename(RequestedHelpItem& request); + static void WarnFormFromFilename(RequestedHelpItem& request, bool& result); }; #endif |