ROSE 0.11.145.147
|
Functor to configure diagnostics.
This functor uses the string(s) from the specified switch key to configure the specified message facilities object. If a string is the word "list" then the message facility configuration is shown on standard output. If the string is the word "help" then some documentation is emitted on std::cout
and the program optionally exits with success (depending on exitOnHelp
).
Here's an example usage. In particular, be sure to specify SAVE_ALL so that more than one –log
switch can appear on the command line, like: a.out –log ">=info" –log list
Definition at line 1726 of file Sawyer/CommandLine.h.
#include <Sawyer/CommandLine.h>
Public Types | |
typedef SharedPointer< ConfigureDiagnostics > | Ptr |
Reference counting pointer for this class. | |
Public Types inherited from Sawyer::CommandLine::SwitchAction | |
typedef SharedPointer< SwitchAction > | Ptr |
Reference counting pointer for this class. | |
Public Member Functions | |
bool | exitOnHelp () const |
Property: program exit after help is displayed. | |
void | exitOnHelp (bool b) |
Property: program exit after help is displayed. | |
Public Member Functions inherited from Sawyer::CommandLine::SwitchAction | |
void | run (const ParserResult &parserResult) |
Runs the action. | |
Public Member Functions inherited from Sawyer::SharedObject | |
SharedObject () | |
Default constructor. | |
SharedObject (const SharedObject &) | |
Copy constructor. | |
virtual | ~SharedObject () |
Virtual destructor. | |
SharedObject & | operator= (const SharedObject &) |
Assignment. | |
Static Public Member Functions | |
static Ptr | instance (const std::string &switchKey, Message::Facilities &facilities, bool exitOnHelp=true) |
Allocating constructor. | |
Protected Member Functions | |
ConfigureDiagnostics (const std::string &switchKey, Message::Facilities &facilities, bool exitOnHelp) | |
Constructor for derived classes. | |
virtual void | operator() (const ParserResult &) |
Reference counting pointer for this class.
Definition at line 1738 of file Sawyer/CommandLine.h.
|
inlineprotected |
Constructor for derived classes.
Non-subclass users should use instance instead.
Definition at line 1734 of file Sawyer/CommandLine.h.
|
inlinestatic |
Allocating constructor.
Returns a pointer to a new ConfigureDiagnostics object. Users will most likely want to use the configureDiagnostics factory instead, which requires less typing.
Definition at line 1744 of file Sawyer/CommandLine.h.
|
inline |
Property: program exit after help is displayed.
If true, then the program exits with success immediately after a "help" command is processed.
Definition at line 1753 of file Sawyer/CommandLine.h.
|
inline |
Property: program exit after help is displayed.
If true, then the program exits with success immediately after a "help" command is processed.
Definition at line 1754 of file Sawyer/CommandLine.h.
|
protectedvirtual |
Implements Sawyer::CommandLine::SwitchAction.