The class to hold the list of options.
More...
#include <mia/core/cmdlineparser.hh>
The class to hold the list of options.
This class holds all the user defined and default command line option, handles the parsing and the printing of help.
- Todo:
- the whole command line option class structure needs a code cleanup
Definition at line 229 of file cmdlineparser.hh.
This enum describes the type of help information that has been requested
Enumerator |
---|
hr_no |
no help has been requested
|
hr_help |
standard help output has been requested
|
hr_help_xml |
XML-formatted help has been requested
|
hr_usage |
a short usage description has been requested
|
hr_version |
The version information has been requested
|
hr_copyright |
The long copyright information has been requested
|
Definition at line 235 of file cmdlineparser.hh.
Constructor creates the options list and adds some defaut options like –help, –verbose, –copyright, and –usage
- Parameters
-
description | give a description of the program |
CCmdOptionList::~CCmdOptionList |
( |
) | |
|
add a new option to the option list
- Parameters
-
void CCmdOptionList::add |
( |
const std::string & |
group, |
|
|
PCmdOption |
opt |
|
) |
| |
Add a new option to an option group
- Parameters
-
group | option group to add this option to |
opt | the option to add |
const std::vector<std::string>& CCmdOptionList::get_remaining |
( |
) | |
const |
- Returns
- a vector of the remaining arguments
- Returns
- the values of all arguments as a history record to support tracking of changes on data worked on by mia
the work routine, can take the arguemnts straight from main This version parses the command line and allows for additional arguments that can be read by get_remaining().
- Parameters
-
argc | number of arguments |
args | array of arguments strings |
additional_type | will is a help string to describe the type of free parameters |
additional_help | If you use a plug-in handler to process the free parameters then pass the pointer to the according plug-in handler here, so that the help system can create proper documentation |
EHelpRequested CCmdOptionList::parse |
( |
size_t |
argc, |
|
|
const char * |
args[], |
|
|
const std::string & |
additional_type, |
|
|
const CPluginHandlerBase * |
additional_help = NULL |
|
) |
| |
the work routine, can take the arguemnts straight from main This version parses the command line and allows for additional arguments that can be read by get_remaining().
- Parameters
-
argc | number of arguments |
args | array of arguments strings |
additional_type | will is a help string to describe the type of free parameters |
additional_help | If you use a plug-in handler to process the free parameters then pass the pointer to the according plug-in handler here, so that the help system can create proper documentation |
the work routine, can take the arguemnts straight from main This version parses doesn't allow additional parameters.
- Parameters
-
argc | number of arguments |
args | array of arguments strings |
EHelpRequested CCmdOptionList::parse |
( |
size_t |
argc, |
|
|
const char * |
args[] |
|
) |
| |
the work routine, can take the arguemnts straight from main This version parses doesn't allow additional parameters.
- Parameters
-
argc | number of arguments |
args | array of arguments strings |
void CCmdOptionList::set_group |
( |
const std::string & |
group) | |
|
Set the option group to add subsequent options to
- Parameters
-
void CCmdOptionList::set_logstream |
( |
std::ostream & |
os) | |
|
Set the output stream for help/usage messages
- Parameters
-
The documentation for this class was generated from the following file: