From 6e68bc22733817783117b20efb8bf0169e9e98c7 Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 23 Sep 2013 13:42:49 -0400 Subject: [PATCH] cmake: Add --help-policy-list option All the other --help- options have a corresponding option --help--list. Add one for --help-policy. --- Source/cmDocumentation.cxx | 9 +++++++++ Source/cmDocumentationFormatter.h | 2 +- Source/cmakemain.cxx | 6 ++++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/Source/cmDocumentation.cxx b/Source/cmDocumentation.cxx index 58ce36bb7..74bdc8433 100644 --- a/Source/cmDocumentation.cxx +++ b/Source/cmDocumentation.cxx @@ -371,6 +371,9 @@ bool cmDocumentation::PrintDocumentation(Type ht, std::ostream& os, this->PrintDocumentationList(os,i->c_str()); } return true; + case cmDocumentation::PolicyList: + this->PrintDocumentationList(os,"Policies"); + return true; case cmDocumentation::Full: return this->PrintDocumentationFull(os); case cmDocumentation::Modules: @@ -1256,6 +1259,12 @@ bool cmDocumentation::CheckOptions(int argc, const char* const* argv, GET_OPT_ARGUMENT(help.Filename); help.HelpForm = cmDocumentation::TextForm; } + else if(strcmp(argv[i], "--help-policy-list") == 0) + { + help.HelpType = cmDocumentation::PolicyList; + GET_OPT_ARGUMENT(help.Filename); + help.HelpForm = cmDocumentation::TextForm; + } else if(strcmp(argv[i], "--copyright") == 0) { help.HelpType = cmDocumentation::Copyright; diff --git a/Source/cmDocumentationFormatter.h b/Source/cmDocumentationFormatter.h index 665b9b61a..d8ce6138c 100644 --- a/Source/cmDocumentationFormatter.h +++ b/Source/cmDocumentationFormatter.h @@ -26,7 +26,7 @@ public: /** Types of help provided. */ enum Type { None, Usage, Single, SingleModule, SingleProperty, SingleVariable, - List, ModuleList, PropertyList, VariableList, + List, ModuleList, PropertyList, VariableList, PolicyList, Full, Properties, Variables, Modules, CustomModules, Commands, CompatCommands, Copyright, Version, Policies, SinglePolicy }; diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx index 73c76e487..a9fc15f1a 100644 --- a/Source/cmakemain.cxx +++ b/Source/cmakemain.cxx @@ -195,6 +195,12 @@ static const char * cmDocumentationOptions[][3] = "If a file is specified, the documentation is written into and the output " "format is determined depending on the filename suffix. Supported are man " "page, HTML, DocBook and plain text."}, + {"--help-policy-list [file]", "List available policies and exit.", + "The list contains all policies for which help may be obtained by using " + "the --help-policy argument followed by a policy name. " + "If a file is specified, the documentation is written into and the output " + "format is determined depending on the filename suffix. Supported are man " + "page, HTML, DocBook and plain text."}, {"--help-policies [file]", "Print help for all policies and exit.", "Full documentation for all policies is displayed." "If a file is specified, the documentation is written into and the output "