|
| program () |
| Constructor.
|
|
virtual | ~program () |
| Destructor.
|
|
program & | operator() (int ac, char **av) |
| Run the program and process any uncaught exceptions.
|
|
program & | operator() (const std::string &command, const std::vector< std::string > &args) |
| Run the program and process any uncaught exceptions.
|
|
int | status () const |
| Get the return status of the program.
|
|
template<class T > |
void | add_option (const std::string &longshort, T *target, const std::string &info, const std::string &aux_info=std::string()) |
| Add a new cmd line option.
|
|
template<class T > |
void | add_option (const std::string &longshort, T *target, const std::string &info, const OptionFlags def, const std::string &aux_info=std::string()) |
| Add a new cmd line option.
|
|
template<class T > |
void | add_option (const std::string &longshort, const std::string &conflicts_with, T *target, const std::string &info, const std::string &aux_info=std::string()) |
| Add a new cmd line option.
|
|
template<class T > |
void | add_option (const std::string &longshort, const std::string &conflicts_with, T *target, const std::string &info, const OptionFlags def, const std::string &aux_info=std::string()) |
| Add a new cmd line option. More...
|
|
template<typename T > |
void | add_residualargs (T *const target, const std::string &name, const OptionFlags def) |
| Provide parsers for non-option command line arguments; if not provided, specifying a non-opt. arg throws a usage_error. More...
|
|
template<typename T > |
void | add_residualargs (T *const target, const std::string &name="FILES", const std::string &conflicts_with=std::string(), const OptionFlags def=shore::OPT_NOTSET, typename boost::disable_if< boost::is_const< T > >::type *dummy=0) |
| Provide parsers for non-option command line arguments; if not provided, specifying a non-opt. arg throws a usage_error. More...
|
|
void | add_residualargs (const std::string &opt_id, const std::string &name) |
| Specify that non-option arguments are euivalent to an option. More...
|
|
void | set_configfile (const std::string &fn) |
| Set a configuration file that is parsed before parsing the command line.
|
|
void | set_optiongroup (const std::string &g=std::string()) |
| Set the group that new options are added to; set an empty group name to hide options in the usage.
|
|
void | set_description (const std::string &desc) |
| Set up a program description to be diplayed along with the help message.
|
|
virtual const std::string & | get_description () const |
| Get program description to be diplayed along with the help message.
|
|
void | set_usage_description (const std::string &desc) |
|
void | set_title (const std::string &t) |
|
void | set_programname (const std::string &name) |
| Set the name of the program (av[0] by default).
|
|
const std::string & | get_programname () const |
| Get the name of the program (av[0] by default).
|
|
void | set_helpcmd (const std::string &cmd) |
| Set a command to display an extended help.
|
|
bool | is_altered (const void *const ptr) const |
| Test if a given value was redefined through a command line option.
|
|
size_t | num_altered () const |
| Get the number of altered command line options.
|
|
const std::string & | get_commandline () const |
| Get the command line string passed to the program.
|
|
av_parser & | get_optionparser () |
| Get a reference to the option parser.
|
|
shore::uncaught_handler * | get_uncaught_handler () |
| Get a pointer to the uncaught exception handler. More...
|
|
const av_parser & | get_optionparser () const |
| Get a reference to the option parser.
|
|
void | set_show_extended_help (const bool f) |
| Show a detailed help page instead of running the program.
|
|
void | set_show_usage_description (const bool f) |
|
virtual void | show_usage () const |
| Display a help message on the command line.
|
|
std::string | startup_message () const |
|
std::string | shutdown_message () const |
|
Program base class.
Handles command line option parsing, displaying of a usage page, and reporting of fatal errors.
After parsing the command line, the virtual main() method is called and all exception thrown by main are reported. Subclasses can provide command line options via add_option().