summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2013-10-16 12:54:52 -0400
committerBrad King <brad.king@kitware.com>2013-10-16 16:24:51 -0400
commit9b212ad01a31bebe30975ab43a6a675eb78f9144 (patch)
tree6066e4fc9ed2a2972185a419439429a74dc78793 /Source
parent5dde65ac5b1ecdcc5b47bdba1b806a25fe6d3402 (diff)
downloadcmake-9b212ad01a31bebe30975ab43a6a675eb78f9144.tar.gz
Make --help-* options available from all command-line tools
Make the standard --help-* options available from all command-line tools. Drop options that are no longer supported: --copyright, --help-full, --help-html, --help-man, --help-compatcommands, --help-custom-modules De-duplicate Help/manual/*.1.rst help options by using an OPTIONS_HELP.txt file included from each manual.
Diffstat (limited to 'Source')
-rw-r--r--Source/CPack/cpack.cxx8
-rw-r--r--Source/CursesDialog/ccmake.cxx2
-rw-r--r--Source/QtDialog/CMakeSetup.cxx7
-rw-r--r--Source/cmDocumentation.cxx44
-rw-r--r--Source/cmDocumentation.h2
-rw-r--r--Source/cmakemain.cxx21
-rw-r--r--Source/ctest.cxx8
7 files changed, 47 insertions, 45 deletions
diff --git a/Source/CPack/cpack.cxx b/Source/CPack/cpack.cxx
index 677f5b1ae0..169ae9a4bf 100644
--- a/Source/CPack/cpack.cxx
+++ b/Source/CPack/cpack.cxx
@@ -55,13 +55,6 @@ static const char * cmDocumentationOptions[][2] =
{"-R <package version>","override/define CPACK_PACKAGE_VERSION"},
{"-B <package directory>","override/define CPACK_PACKAGE_DIRECTORY"},
{"--vendor <vendor name>","override/define CPACK_PACKAGE_VENDOR"},
- {"--help-command cmd [file]", "Print help for a single command and exit."},
- {"--help-command-list [file]", "List available commands and exit."},
- {"--help-commands [file]", "Print help for all commands and exit."},
- {"--help-variable var [file]",
- "Print help for a single variable and exit."},
- {"--help-variable-list [file]", "List documented variables and exit."},
- {"--help-variables [file]", "Print help for all variables and exit."},
{0,0}
};
@@ -235,6 +228,7 @@ int main (int argc, char *argv[])
// This part is used for cpack documentation lookup as well.
cminst.AddCMakePaths();
+ doc.SetCMakeRoot(cminst.GetCacheDefinition("CMAKE_ROOT"));
if ( parsed && !help )
{
diff --git a/Source/CursesDialog/ccmake.cxx b/Source/CursesDialog/ccmake.cxx
index 3855d530a4..fdfe331c34 100644
--- a/Source/CursesDialog/ccmake.cxx
+++ b/Source/CursesDialog/ccmake.cxx
@@ -86,6 +86,8 @@ int main(int argc, char** argv)
if(doc.CheckOptions(argc, argv))
{
cmake hcm;
+ hcm.AddCMakePaths();
+ doc.SetCMakeRoot(hcm.GetCacheDefinition("CMAKE_ROOT"));
std::vector<cmDocumentationEntry> generators;
hcm.GetGeneratorDocumentation(generators);
doc.SetName("ccmake");
diff --git a/Source/QtDialog/CMakeSetup.cxx b/Source/QtDialog/CMakeSetup.cxx
index cfefab2ee1..095aeb648a 100644
--- a/Source/QtDialog/CMakeSetup.cxx
+++ b/Source/QtDialog/CMakeSetup.cxx
@@ -58,12 +58,7 @@ int main(int argc, char** argv)
// Construct and print requested documentation.
cmake hcm;
hcm.AddCMakePaths();
- // just incase the install is bad avoid a seg fault
- const char* root = hcm.GetCacheDefinition("CMAKE_ROOT");
- if(root)
- {
- doc.SetCMakeRoot(root);
- }
+ doc.SetCMakeRoot(hcm.GetCacheDefinition("CMAKE_ROOT"));
std::vector<cmDocumentationEntry> generators;
hcm.GetGeneratorDocumentation(generators);
diff --git a/Source/cmDocumentation.cxx b/Source/cmDocumentation.cxx
index 2d7feab778..682478eed8 100644
--- a/Source/cmDocumentation.cxx
+++ b/Source/cmDocumentation.cxx
@@ -25,12 +25,44 @@
//----------------------------------------------------------------------------
static const char *cmDocumentationStandardOptions[][2] =
{
- {"--copyright [file]", "Print the CMake copyright and exit."},
- {"--help,-help,-usage,-h,-H,/?", "Print usage information and exit."},
- {"--help-full [file]", "Print full help and exit."},
- {"--help-html [file]", "Print full help in HTML format."},
- {"--help-man [file]", "Print full help as a UNIX man page and exit."},
- {"--version,-version,/V [file]"},
+ {"--help,-help,-usage,-h,-H,/?",
+ "Print usage information and exit."},
+ {"--version,-version,/V [<f>]",
+ "Print version number and exit."},
+ {"--help-manual <man> [<f>]",
+ "Print one help manual and exit."},
+ {"--help-manual-list [<f>]",
+ "List help manuals available and exit."},
+ {"--help-command <cmd> [<f>]",
+ "Print help for one command and exit."},
+ {"--help-command-list [<f>]",
+ "List commands with help available and exit."},
+ {"--help-commands [<f>]",
+ "Print cmake-commands manual and exit."},
+ {"--help-module <mod> [<f>]",
+ "Print help for one module and exit."},
+ {"--help-module-list [<f>]",
+ "List modules with help available and exit."},
+ {"--help-modules [<f>]",
+ "Print cmake-modules manual and exit."},
+ {"--help-policy <cmp> [<f>]",
+ "Print help for one policy and exit."},
+ {"--help-policy-list [<f>]",
+ "List policies with help available and exit."},
+ {"--help-policies [<f>]",
+ "Print cmake-policies manual and exit."},
+ {"--help-property <prop> [<f>]",
+ "Print help for one property and exit."},
+ {"--help-property-list [<f>]",
+ "List properties with help available and exit."},
+ {"--help-properties [<f>]",
+ "Print cmake-properties manual and exit."},
+ {"--help-variable var [<f>]",
+ "Print help for one variable and exit."},
+ {"--help-variable-list [<f>]",
+ "List variables with help available and exit."},
+ {"--help-variables [<f>]",
+ "Print cmake-variables manual and exit."},
{0,0}
};
diff --git a/Source/cmDocumentation.h b/Source/cmDocumentation.h
index a4072c51c0..07e614db6c 100644
--- a/Source/cmDocumentation.h
+++ b/Source/cmDocumentation.h
@@ -84,7 +84,7 @@ public:
cmDocumentationEntry &docs);
/** Set cmake root so we can find installed files */
- void SetCMakeRoot(const char* root) { this->CMakeRoot = root;}
+ void SetCMakeRoot(const char* root) { this->CMakeRoot = root? root:"";}
/** Add common (to all tools) documentation section(s) */
void addCommonStandardDocSections();
diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx
index 6e2125fac0..5b534f0ea9 100644
--- a/Source/cmakemain.cxx
+++ b/Source/cmakemain.cxx
@@ -79,27 +79,6 @@ static const char * cmDocumentationOptions[][2] =
{"--no-warn-unused-cli", "Don't warn about command line options."},
{"--check-system-vars", "Find problems with variable usage in system "
"files."},
- {"--help-command cmd [file]", "Print help for a single command and exit."},
- {"--help-command-list [file]", "List available listfile commands and exit."},
- {"--help-commands [file]", "Print help for all commands and exit."},
- {"--help-compatcommands [file]", "Print help for compatibility commands. "},
- {"--help-module module [file]", "Print help for a single module and exit."},
- {"--help-module-list [file]", "List available modules and exit."},
- {"--help-modules [file]", "Print help for all modules and exit."},
- {"--help-custom-modules [file]" , "Print help for all custom modules and "
- "exit."},
- {"--help-policy cmp [file]",
- "Print help for a single policy and exit."},
- {"--help-policy-list [file]", "List available policies and exit."},
- {"--help-policies [file]", "Print help for all policies and exit."},
- {"--help-property prop [file]",
- "Print help for a single property and exit."},
- {"--help-property-list [file]", "List available properties and exit."},
- {"--help-properties [file]", "Print help for all properties and exit."},
- {"--help-variable var [file]",
- "Print help for a single variable and exit."},
- {"--help-variable-list [file]", "List documented variables and exit."},
- {"--help-variables [file]", "Print help for all variables and exit."},
{0,0}
};
diff --git a/Source/ctest.cxx b/Source/ctest.cxx
index 6e3a86b4e2..16cdd13652 100644
--- a/Source/ctest.cxx
+++ b/Source/ctest.cxx
@@ -107,10 +107,6 @@ static const char * cmDocumentationOptions[][2] =
{"--http1.0", "Submit using HTTP 1.0."},
{"--no-compress-output", "Do not compress test output when submitting."},
{"--print-labels", "Print all available test labels."},
- {"--help-command <cmd> [<file>]",
- "Show help for a single command and exit."},
- {"--help-command-list [<file>]", "List available commands and exit."},
- {"--help-commands [<file>]", "Print help for all commands and exit."},
{0,0}
};
@@ -153,6 +149,10 @@ int main (int argc, char *argv[])
doc.addCTestStandardDocSections();
if(doc.CheckOptions(argc, argv))
{
+ cmake hcm;
+ hcm.AddCMakePaths();
+ doc.SetCMakeRoot(hcm.GetCacheDefinition("CMAKE_ROOT"));
+
// Construct and print requested documentation.
cmCTestScriptHandler* ch =
static_cast<cmCTestScriptHandler*>(inst.GetHandler("script"));