* \author Teemu Murtola <teemu.murtola@gmail.com>
* \ingroup module_commandline
*/
-#include "gromacs/commandline/cmdlinehelpmodule.h"
+#include "gmxpre.h"
+
+#include "cmdlinehelpmodule.h"
#include <string>
#include <vector>
#include "gromacs/commandline/cmdlinehelpcontext.h"
#include "gromacs/commandline/cmdlinehelpwriter.h"
#include "gromacs/commandline/cmdlineparser.h"
-#include "gromacs/commandline/shellcompletions.h"
#include "gromacs/onlinehelp/helpformat.h"
#include "gromacs/onlinehelp/helpmanager.h"
#include "gromacs/onlinehelp/helptopic.h"
#include "gromacs/utility/programcontext.h"
#include "gromacs/utility/stringutil.h"
+#include "shellcompletions.h"
+
namespace gmx
{
*
* Does not throw.
*/
- explicit RootHelpTopic(const std::string &binaryName)
- : binaryName_(binaryName)
+ explicit RootHelpTopic(const CommandLineHelpModuleImpl &helpModule)
+ : helpModule_(helpModule)
{
}
virtual void writeHelp(const HelpWriterContext &context) const;
private:
- std::string binaryName_;
+ const CommandLineHelpModuleImpl &helpModule_;
GMX_DISALLOW_COPY_AND_ASSIGN(RootHelpTopic);
};
}
{
CommandLineCommonOptionsHolder optionsHolder;
- CommandLineHelpContext cmdlineContext(context);
+ CommandLineHelpContext cmdlineContext(*helpModule_.context_);
+ cmdlineContext.setModuleDisplayName(helpModule_.binaryName_);
optionsHolder.initOptions();
- cmdlineContext.setModuleDisplayName(binaryName_);
// TODO: Add <command> [<args>] into the synopsis.
- // TODO: Propagate the -hidden option here.
CommandLineHelpWriter(*optionsHolder.options())
.writeHelp(cmdlineContext);
}
const std::string &binaryName,
const CommandLineModuleMap &modules,
const CommandLineModuleGroupList &groups)
- : rootTopic_(new RootHelpTopic(binaryName)), programContext_(programContext),
+ : rootTopic_(new RootHelpTopic(*this)), programContext_(programContext),
binaryName_(binaryName), modules_(modules), groups_(groups),
context_(NULL), moduleOverride_(NULL), bHidden_(false),
outputOverride_(NULL)