ROSE 0.11.145.147
|
Wrapper around Sawyer's CommandLine class.
Definition at line 98 of file CommandLineBoost.h.
#include <Sawyer/CommandLineBoost.h>
Public Member Functions | |
command_line_parser (int argc, char *argv[]) | |
Construct a parser. | |
command_line_parser & | allow_unregistered () |
Add predefined switches. | |
Sawyer::CommandLine::ParserResult | run () |
Parse command-line. | |
command_line_parser & | options (const options_description &) |
Insert specified switch declarations. | |
command_line_parser & | options (const Sawyer::CommandLine::SwitchGroup &) |
Insert specified switch declarations. | |
Public Attributes | |
int | argc |
Argument count saved by c'tor to be available during parsing. | |
char ** | argv |
Arguments saved by c'tor to be available during parsing. | |
Sawyer::CommandLine::Parser | parser |
Wrapped parser. | |
|
inline |
Construct a parser.
The command-line is not actually parsed here – its only saved by reference until run is called.
Definition at line 106 of file CommandLineBoost.h.
References Sawyer::CommandLine::Parser::errorStream(), Sawyer::Message::FATAL, Sawyer::Message::mlog, and parser.
|
inline |
Add predefined switches.
The boost version of this method causes boost to capture values of switches that have not been declared. Although Sawyer is also capable of skipping over and accumulating arguments that look like switches but which have not been declared, doing so is fraught with danger. Imagine the synchronization and missing code problems that would result if a source code compiler took this same approach!
Definition at line 123 of file CommandLineBoost.h.
|
inline |
Parse command-line.
Parses the command line and return results. If the syntax is good, this also runs the "--help" switch if present.
Definition at line 128 of file CommandLineBoost.h.
References Sawyer::CommandLine::ParserResult::apply(), argc, argv, Sawyer::CommandLine::Parser::parse(), and parser.
int Sawyer::CommandLine::Boost::command_line_parser::argc |
Argument count saved by c'tor to be available during parsing.
Definition at line 99 of file CommandLineBoost.h.
Referenced by run().
char** Sawyer::CommandLine::Boost::command_line_parser::argv |
Arguments saved by c'tor to be available during parsing.
Definition at line 100 of file CommandLineBoost.h.
Referenced by run().
Sawyer::CommandLine::Parser Sawyer::CommandLine::Boost::command_line_parser::parser |
Wrapped parser.
Definition at line 101 of file CommandLineBoost.h.
Referenced by command_line_parser(), and run().