[Cmake-commits] CMake branch, next, updated. v3.0.0-3713-gffc8a8d

Brad King brad.king at kitware.com
Fri Jun 13 08:41:10 EDT 2014


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  ffc8a8dbda5595d3a24dec356b3eab2c6c4427eb (commit)
       via  de7c2882ff053ebdb60c57caa4f0cef87161fede (commit)
      from  4827bdf8f07bac2a3dda0280f8ef5c516a8902fa (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ffc8a8dbda5595d3a24dec356b3eab2c6c4427eb
commit ffc8a8dbda5595d3a24dec356b3eab2c6c4427eb
Merge: 4827bdf de7c288
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Jun 13 08:41:09 2014 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Fri Jun 13 08:41:09 2014 -0400

    Merge topic 'cmake-no-args-output' into next
    
    de7c2882 cmake,ccmake: Produce shorter output on no arguments (#14973)


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=de7c2882ff053ebdb60c57caa4f0cef87161fede
commit de7c2882ff053ebdb60c57caa4f0cef87161fede
Author:     Adam Strzelecki <ono at java.pl>
AuthorDate: Thu Jun 12 22:18:32 2014 +0200
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Fri Jun 13 08:36:43 2014 -0400

    cmake,ccmake: Produce shorter output on no arguments (#14973)
    
    Instead printing complete help cmake/ccmake now prints only Usage section and
    extra information how to get more help or start your build.
    
    Implementation Details:
    
      Usage help type was renamed to Help, and new Usage was introduces that prints
      only command line usage information without any extra details.
    
      Commands add some extra information when no arguments are passed.

diff --git a/Source/CursesDialog/ccmake.cxx b/Source/CursesDialog/ccmake.cxx
index a9d4d98..516e44d 100644
--- a/Source/CursesDialog/ccmake.cxx
+++ b/Source/CursesDialog/ccmake.cxx
@@ -38,6 +38,18 @@ static const char * cmDocumentationUsage[][2] =
   {0,
    "  ccmake <path-to-source>\n"
    "  ccmake <path-to-existing-build>"},
+  {0,
+   "Specify a source directory to (re-)generate a build system for "
+   "it in the current working directory.  Specify an existing build "
+   "directory to re-generate its build system."},
+  {0,0}
+};
+
+//----------------------------------------------------------------------------
+static const char * cmDocumentationUsageNote[][2] =
+{
+  {0,
+   "Run 'ccmake --help' for more information."},
   {0,0}
 };
 
@@ -102,6 +114,10 @@ int main(int argc, char const* const* argv)
     doc.SetName("ccmake");
     doc.SetSection("Name",cmDocumentationName);
     doc.SetSection("Usage",cmDocumentationUsage);
+    if ( argc == 1 )
+      {
+      doc.AppendSection("Usage",cmDocumentationUsageNote);
+      }
     doc.SetSection("Generators",generators);
     doc.PrependSection("Options",cmDocumentationOptions);
     return doc.PrintRequestedDocumentation(std::cout)? 0:1;
diff --git a/Source/cmDocumentation.cxx b/Source/cmDocumentation.cxx
index 8d035af..3ff1017 100644
--- a/Source/cmDocumentation.cxx
+++ b/Source/cmDocumentation.cxx
@@ -113,7 +113,9 @@ bool cmDocumentation::PrintDocumentation(Type ht, std::ostream& os)
   switch (ht)
     {
     case cmDocumentation::Usage:
-      return this->PrintDocumentationUsage(os);
+      return this->PrintUsage(os);
+    case cmDocumentation::Help:
+      return this->PrintHelp(os);
     case cmDocumentation::Full:
       return this->PrintHelpFull(os);
     case cmDocumentation::OneManual:
@@ -300,7 +302,7 @@ bool cmDocumentation::CheckOptions(int argc, const char* const* argv,
        (strcmp(argv[i], "-h") == 0) ||
        (strcmp(argv[i], "-H") == 0))
       {
-      help.HelpType = cmDocumentation::Usage;
+      help.HelpType = cmDocumentation::Help;
       GET_OPT_ARGUMENT(help.Argument);
       help.Argument = cmSystemTools::LowerCase(help.Argument);
       // special case for single command
@@ -841,7 +843,19 @@ bool cmDocumentation::PrintHelpListVariables(std::ostream& os)
 }
 
 //----------------------------------------------------------------------------
-bool cmDocumentation::PrintDocumentationUsage(std::ostream& os)
+bool cmDocumentation::PrintUsage(std::ostream& os)
+{
+  std::map<std::string,cmDocumentationSection*>::iterator si;
+  si = this->AllSections.find("Usage");
+  if(si != this->AllSections.end())
+    {
+    this->Formatter.PrintSection(os, *si->second);
+    }
+  return true;
+}
+
+//----------------------------------------------------------------------------
+bool cmDocumentation::PrintHelp(std::ostream& os)
 {
   std::map<std::string,cmDocumentationSection*>::iterator si;
   si = this->AllSections.find("Usage");
diff --git a/Source/cmDocumentation.h b/Source/cmDocumentation.h
index c98e48e..b72b5fe 100644
--- a/Source/cmDocumentation.h
+++ b/Source/cmDocumentation.h
@@ -102,6 +102,8 @@ private:
   bool PrintFiles(std::ostream& os, std::string const& pattern);
 
   bool PrintVersion(std::ostream& os);
+  bool PrintUsage(std::ostream& os);
+  bool PrintHelp(std::ostream& os);
   bool PrintHelpFull(std::ostream& os);
   bool PrintHelpOneManual(std::ostream& os);
   bool PrintHelpOneCommand(std::ostream& os);
@@ -115,7 +117,6 @@ private:
   bool PrintHelpListProperties(std::ostream& os);
   bool PrintHelpListVariables(std::ostream& os);
   bool PrintHelpListPolicies(std::ostream& os);
-  bool PrintDocumentationUsage(std::ostream& os);
   bool PrintOldCustomModules(std::ostream& os);
 
   const char* GetNameString() const;
diff --git a/Source/cmDocumentationFormatter.h b/Source/cmDocumentationFormatter.h
index 61766b9..59513cc 100644
--- a/Source/cmDocumentationFormatter.h
+++ b/Source/cmDocumentationFormatter.h
@@ -26,7 +26,7 @@ public:
   /** Types of help provided.  */
   enum Type
   {
-    None, Version, Usage, Full, ListManuals,
+    None, Version, Usage, Help, Full, ListManuals,
     ListCommands, ListModules, ListProperties, ListVariables, ListPolicies,
     OneManual, OneCommand, OneModule, OneProperty, OneVariable, OnePolicy,
     OldCustomModules
diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx
index 9f9f6bb..085f263 100644
--- a/Source/cmakemain.cxx
+++ b/Source/cmakemain.cxx
@@ -42,6 +42,18 @@ static const char * cmDocumentationUsage[][2] =
   {0,
    "  cmake [options] <path-to-source>\n"
    "  cmake [options] <path-to-existing-build>"},
+  {0,
+   "Specify a source directory to (re-)generate a build system for "
+   "it in the current working directory.  Specify an existing build "
+   "directory to re-generate its build system."},
+  {0,0}
+};
+
+//----------------------------------------------------------------------------
+static const char * cmDocumentationUsageNote[][2] =
+{
+  {0,
+   "Run 'cmake --help' for more information."},
   {0,0}
 };
 
@@ -223,6 +235,10 @@ int do_cmake(int ac, char const* const* av)
     doc.SetName("cmake");
     doc.SetSection("Name",cmDocumentationName);
     doc.SetSection("Usage",cmDocumentationUsage);
+    if ( ac == 1 )
+      {
+      doc.AppendSection("Usage",cmDocumentationUsageNote);
+      }
     doc.AppendSection("Generators",generators);
     doc.PrependSection("Options",cmDocumentationOptions);
 

-----------------------------------------------------------------------

Summary of changes:
 Source/CursesDialog/ccmake.cxx    |   16 ++++++++++++++++
 Source/cmDocumentation.cxx        |   20 +++++++++++++++++---
 Source/cmDocumentation.h          |    3 ++-
 Source/cmDocumentationFormatter.h |    2 +-
 Source/cmakemain.cxx              |   16 ++++++++++++++++
 5 files changed, 52 insertions(+), 5 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list