Teach --help-* options to load documentation from .rst files

Install the Help directory next to Modules to make it available in CMake
distributions.  Use cmRST to read Help .rst documents and print them as
help output.

Add options

 --help-manual-list
 --help-manual

to list available manuals or print one of them.  Implement the options

 --help-commands
 --help-modules
 --help-policies
 --help-properties
 --help-variables

by mapping to the corresponding manual page.  Implement the options

 --help-command-list
 --help-module-list
 --help-policy-list
 --help-property-list
 --help-variable-list

by globbing the available Help .rst documents of the corresponding type
and reading their titles.  Implement the options

 --help-command
 --help-module
 --help-policy
 --help-property
 --help-variable

by globbing the matching Help .rst document(s) and printing them.
This commit is contained in:
Brad King
2013-09-16 11:29:06 -04:00
parent 25f2877eef
commit ec6df3675e
6 changed files with 309 additions and 37 deletions
+7
View File
@@ -200,6 +200,13 @@ std::string cmSystemTools::EscapeQuotes(const char* str)
return result;
}
std::string cmSystemTools::HelpFileName(std::string name)
{
cmSystemTools::ReplaceString(name, "<", "");
cmSystemTools::ReplaceString(name, ">", "");
return name;
}
std::string cmSystemTools::TrimWhitespace(const std::string& s)
{
std::string::const_iterator start = s.begin();