Renamed AsciiHelpWriter to CommandLineHelpWriter.
authorTeemu Murtola <teemu.murtola@gmail.com>
Wed, 18 Apr 2012 15:17:18 +0000 (18:17 +0300)
committerTeemu Murtola <teemu.murtola@gmail.com>
Wed, 18 Apr 2012 15:21:36 +0000 (18:21 +0300)
Kept the changes to a minimum to avoid messing the git rename detect.
Will rename/reorganize the code a bit more in a separate commit.
Also install the files, since they are documented as being part of the
public API.

IssueID #666

Change-Id: I96cf743d9364f80624ae3424c99019ae824e1520

src/gromacs/options.h
src/gromacs/options/CMakeLists.txt
src/gromacs/options/cmdlinehelpwriter-impl.h [moved from src/gromacs/options/asciihelpwriter-impl.h with 93% similarity]
src/gromacs/options/cmdlinehelpwriter.cpp [moved from src/gromacs/options/asciihelpwriter.cpp with 92% similarity]
src/gromacs/options/cmdlinehelpwriter.h [moved from src/gromacs/options/asciihelpwriter.h with 86% similarity]
src/gromacs/trajectoryanalysis/cmdlinerunner.cpp

index c8e913395d5672a12bafdb7eee75a11f225ab010..d7b2edec8fdb2aa62fc2ee7f6b8c7d97c722c823 100644 (file)
@@ -51,7 +51,7 @@
  * is possible to add descriptions for individual options as well as for the
  * whole set of options.  These can then be used to write out a help using one
  * of the provided help writers.
- * Currently, only one is defined: AsciiHelpWriter
+ * Currently, only one is defined: CommandLineHelpWriter
  * (implementation is not yet complete).
  *
  * \if libapi
index 2242af8cbdaa48e197511165437fb30fe7ad9c78..c120a2a0cafbce2e8617babaf63b76db539c76a0 100644 (file)
@@ -5,6 +5,8 @@ set(OPTIONS_PUBLIC_HEADERS
     abstractoption.h
     basicoptioninfo.h
     basicoptions.h
+    cmdlinehelpwriter.h
+    cmdlineparser.h
     optionfiletype.h
     optionflags.h
     optioninfo.h
similarity index 93%
rename from src/gromacs/options/asciihelpwriter-impl.h
rename to src/gromacs/options/cmdlinehelpwriter-impl.h
index 5318c5adb7b0af1cfec22de4ea35c47990e146d7..0922930003d6c7ba255670e2ecb6404c2264db41 100644 (file)
  */
 /*! \internal \file
  * \brief
- * Declares private implementation class for gmx::AsciiHelpWriter.
+ * Declares private implementation class for gmx::CommandLineHelpWriter.
  *
  * \author Teemu Murtola <teemu.murtola@cbr.su.se>
  * \ingroup module_options
  */
-#ifndef GMX_OPTIONS_ASCIIHELPWRITER_IMPL_HPP
-#define GMX_OPTIONS_ASCIIHELPWRITER_IMPL_HPP
+#ifndef GMX_OPTIONS_CMDLINEHELPWRITER_IMPL_H
+#define GMX_OPTIONS_CMDLINEHELPWRITER_IMPL_H
 
-#include "asciihelpwriter.h"
+#include "cmdlinehelpwriter.h"
 
 #include "basicoptioninfo.h"
 #include "optionsvisitor.h"
@@ -50,11 +50,11 @@ namespace gmx
 class Options;
 
 /*! \internal \brief
- * Private implementation class for AsciiHelpWriter.
+ * Private implementation class for CommandLineHelpWriter.
  *
  * \ingroup module_options
  */
-class AsciiHelpWriter::Impl
+class CommandLineHelpWriter::Impl
 {
     public:
         /*! \brief
similarity index 92%
rename from src/gromacs/options/asciihelpwriter.cpp
rename to src/gromacs/options/cmdlinehelpwriter.cpp
index d9d367e208168eaec9bd5416cee163feca4fda7b..887bd3ae97c7ccfa9efe2216792f0eacdc139ea5 100644 (file)
  */
 /*! \internal \file
  * \brief
- * Implements gmx::AsciiHelpWriter.
+ * Implements gmx::CommandLineHelpWriter.
  *
  * \author Teemu Murtola <teemu.murtola@cbr.su.se>
  * \ingroup module_options
  */
-#include "gromacs/options/asciihelpwriter.h"
+#include "gromacs/options/cmdlinehelpwriter.h"
 
 #include <cstdio>
 #include <cstdlib>
 #include "gromacs/options/options.h"
 #include "gromacs/options/optionsvisitor.h"
 
-#include "asciihelpwriter-impl.h"
+#include "cmdlinehelpwriter-impl.h"
 
 namespace gmx
 {
 
 /********************************************************************
- * AsciiHelpWriter::Impl
+ * CommandLineHelpWriter::Impl
  */
 
-AsciiHelpWriter::Impl::Impl(const Options &options)
+CommandLineHelpWriter::Impl::Impl(const Options &options)
     : _options(options)
 {
 }
@@ -219,31 +219,31 @@ void AsciiParameterWriter::visitOption(const OptionInfo &option)
 }
 
 /********************************************************************
- * AsciiHelpWriter
+ * CommandLineHelpWriter
  */
 
-AsciiHelpWriter::AsciiHelpWriter(const Options &options)
+CommandLineHelpWriter::CommandLineHelpWriter(const Options &options)
     : _impl(new Impl(options))
 {
 }
 
-AsciiHelpWriter::~AsciiHelpWriter()
+CommandLineHelpWriter::~CommandLineHelpWriter()
 {
 }
 
-AsciiHelpWriter &AsciiHelpWriter::setShowHidden(bool bSet)
+CommandLineHelpWriter &CommandLineHelpWriter::setShowHidden(bool bSet)
 {
     _impl->_flags.set(Impl::efShowHidden, bSet);
     return *this;
 }
 
-AsciiHelpWriter &AsciiHelpWriter::setShowDescriptions(bool bSet)
+CommandLineHelpWriter &CommandLineHelpWriter::setShowDescriptions(bool bSet)
 {
     _impl->_flags.set(Impl::efShowDescriptions, bSet);
     return *this;
 }
 
-void AsciiHelpWriter::writeHelp(FILE *fp)
+void CommandLineHelpWriter::writeHelp(FILE *fp)
 {
     if (_impl->_flags.test(Impl::efShowDescriptions))
     {
similarity index 86%
rename from src/gromacs/options/asciihelpwriter.h
rename to src/gromacs/options/cmdlinehelpwriter.h
index a400ef1ff12cacf68ed2ba2831326cf9ee0648db..b7861b5d4b05d9a2198a0bca1639da9a5343a73b 100644 (file)
  */
 /*! \file
  * \brief
- * Declares gmx::AsciiHelpWriter.
+ * Declares gmx::CommandLineHelpWriter.
  *
  * \author Teemu Murtola <teemu.murtola@cbr.su.se>
  * \inpublicapi
  * \ingroup module_options
  */
-#ifndef GMX_OPTIONS_ASCIIHELPWRITER_H
-#define GMX_OPTIONS_ASCIIHELPWRITER_H
+#ifndef GMX_OPTIONS_CMDLINEHELPWRITER_H
+#define GMX_OPTIONS_CMDLINEHELPWRITER_H
 
 #include <cstdio>
 
@@ -54,7 +54,7 @@ class Options;
  * \inpublicapi
  * \ingroup module_options
  */
-class AsciiHelpWriter
+class CommandLineHelpWriter
 {
     public:
         /*! \brief
@@ -62,17 +62,17 @@ class AsciiHelpWriter
          *
          * \param[in] options  Options for which help should be printed.
          */
-        explicit AsciiHelpWriter(const Options &options);
-        ~AsciiHelpWriter();
+        explicit CommandLineHelpWriter(const Options &options);
+        ~CommandLineHelpWriter();
 
         /*! \brief
          * Sets whether hidden options are shown in the help.
          */
-        AsciiHelpWriter &setShowHidden(bool bShow);
+        CommandLineHelpWriter &setShowHidden(bool bShow);
         /*! \brief
          * Sets whether long descriptions for sections are shown in the help.
          */
-        AsciiHelpWriter &setShowDescriptions(bool bShow);
+        CommandLineHelpWriter &setShowDescriptions(bool bShow);
 
         /*! \brief
          * Writes the help.
index c3865f7f21dadd577cdf27d51a84bf59b8b22c5f..292156dcf8cf9f75ecb814a5925091d9041e2c1d 100644 (file)
@@ -45,7 +45,7 @@
 #include "statutil.h"
 
 #include "gromacs/analysisdata/paralleloptions.h"
-#include "gromacs/options/asciihelpwriter.h"
+#include "gromacs/options/cmdlinehelpwriter.h"
 #include "gromacs/options/cmdlineparser.h"
 #include "gromacs/options/options.h"
 #include "gromacs/selection/selectioncollection.h"
@@ -103,7 +103,7 @@ TrajectoryAnalysisCommandLineRunner::Impl::printHelp(
     TrajectoryAnalysisRunnerCommon::HelpFlags flags = common.helpFlags();
     if (flags != 0)
     {
-        AsciiHelpWriter(options)
+        CommandLineHelpWriter(options)
             .setShowDescriptions(flags & TrajectoryAnalysisRunnerCommon::efHelpShowDescriptions)
             .setShowHidden(flags & TrajectoryAnalysisRunnerCommon::efHelpShowHidden)
             .writeHelp(stderr);