Sort all includes in src/gromacs
[alexxy/gromacs.git] / src / gromacs / commandline / cmdlinehelpmodule.h
index 860255cffd9fb2239f0963187d709e1fe2f31b89..6b6d33413c96d48793b412410bf31ef98ab8bc87 100644 (file)
 #ifndef GMX_COMMANDLINE_CMDLINEHELPMODULE_H
 #define GMX_COMMANDLINE_CMDLINEHELPMODULE_H
 
-#include "cmdlinemodule.h"
-#include "cmdlinemodulemanager-impl.h"
-
+#include "gromacs/commandline/cmdlinemodule.h"
 #include "gromacs/onlinehelp/helptopicinterface.h"
 #include "gromacs/utility/common.h"
 
+#include "cmdlinemodulemanager-impl.h"
+
 namespace gmx
 {
 
 class CommandLineHelpContext;
-class ProgramInfo;
+class File;
+class ProgramContextInterface;
 
 class CommandLineHelpModuleImpl;
 
@@ -71,14 +72,14 @@ class CommandLineHelpModule : public CommandLineModuleInterface
         /*! \brief
          * Creates a command-line help module.
          *
-         * \param[in] programInfo Information about the running binary.
-         * \param[in] binaryName  Name of the running binary
+         * \param[in] programContext Information about the running binary.
+         * \param[in] binaryName     Name of the running binary
          *     (without Gromacs binary suffix or .exe on Windows).
          * \param[in] modules  List of modules for to use for module listings.
          * \param[in] groups   List of module groups.
          * \throws    std::bad_alloc if out of memory.
          */
-        CommandLineHelpModule(const ProgramInfo                &programInfo,
+        CommandLineHelpModule(const ProgramContextInterface    &programContext,
                               const std::string                &binaryName,
                               const CommandLineModuleMap       &modules,
                               const CommandLineModuleGroupList &groups);
@@ -113,12 +114,24 @@ class CommandLineHelpModule : public CommandLineModuleInterface
          */
         void setModuleOverride(const CommandLineModuleInterface &module);
 
+        /*! \brief
+         * Sets a file to write help output to instead of default `stdout`.
+         *
+         * Used for unit testing; see
+         * CommandLineModuleManager::setOutputRedirect() for more details.
+         */
+        void setOutputRedirect(File *output);
+
         virtual const char *name() const { return "help"; }
         virtual const char *shortDescription() const
         {
             return "Print help information";
         }
 
+        virtual void init(CommandLineModuleSettings *settings)
+        {
+            settings->setDefaultNiceLevel(0);
+        }
         virtual int run(int argc, char *argv[]);
         virtual void writeHelp(const CommandLineHelpContext &context) const;