#include <gromacs/commandline/cmdlinehelpmodule.h>
Command-line module for producing help.
This module implements the 'help' subcommand that is automatically added by CommandLineModuleManager.
Creates a command-line help module.
- Parameters
-
[in] | programContext | Information about the running binary. |
[in] | binaryName | Name of the running binary (without Gromacs binary suffix or .exe on Windows). |
[in] | modules | List of modules for to use for module listings. |
[in] | groups | List of module groups. |
- Exceptions
-
std::bad_alloc | if out of memory. |
void gmx::CommandLineHelpModule::addTopic |
( |
HelpTopicPointer |
topic, |
|
|
bool |
bExported |
|
) |
| |
Adds a top-level help topic.
- Parameters
-
[in] | topic | Help topic to add. |
[in] | bExported | Whether this topic will be directly exported to the user guide. |
- Exceptions
-
std::bad_alloc | if out of memory. |
Creates a help topic for a command-line module.
- Parameters
-
[in] | module | Module the create the help topic for. |
- Exceptions
-
std::bad_alloc | if out of memory. |
The caller should add the topic using addTopic() if that is desired. This method is provided separately to allow for strong exception safety in CommandLineModuleManager::addModule().
Initializes the module and provides settings for the runner.
This will be called before run(), and can be used to adjust initialization that the runner does.
This method is currently not called when writing the help.
Implements gmx::ICommandLineModule.
int gmx::CommandLineHelpModule::run |
( |
int |
argc, |
|
|
char * |
argv[] |
|
) |
| |
|
overridevirtual |
Runs the module with the given arguments.
- Parameters
-
[in] | argc | Number of elements in argv . |
[in] | argv | Command-line arguments. |
- Exceptions
-
unspecified | May throw exceptions to indicate errors. |
- Returns
- Exit code for the program.
- Return values
-
0 | on successful termination. |
argv
[0] is the name of the module, i.e., the arguments are as if the module was run as a standalone executable.
Implements gmx::ICommandLineModule.
Sets an override to show the help for the given module.
If called, the help module directly prints the help for the given module when called, skipping any other processing.
Prints help for the module.
- Parameters
-
[in] | context | Context object for writing the help. |
- Exceptions
-
std::bad_alloc | if out of memory. |
FileIOError | on any I/O error. |
Note that for MPI-enabled builds, this is called only on the main rank.
Implements gmx::ICommandLineModule.
The documentation for this class was generated from the following files: