|
ROSE 0.11.145.354
|
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 1721 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) |
| 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 1735 of file Sawyer/CommandLine.h.
|
protected |
Constructor for derived classes.
Non-subclass users should use instance instead.
|
static |
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.
| bool Sawyer::CommandLine::ConfigureDiagnostics::exitOnHelp | ( | ) | const |
Property: program exit after help is displayed.
If true, then the program exits with success immediately after a "help" command is processed.
| void Sawyer::CommandLine::ConfigureDiagnostics::exitOnHelp | ( | bool | ) |
Property: program exit after help is displayed.
If true, then the program exits with success immediately after a "help" command is processed.
|
protectedvirtual |
Implements Sawyer::CommandLine::SwitchAction.