EleFits
4.0.1
A modern C++ API on top of CFitsIO
|
#include <ProgramOptions.h>
Helper class to declare positional and named options, and help message.
Here is an example use case for the following command line:
Program <positional> --named1 <value1> --named2 <value2>
Let's assume that the help message is provided in a file help.txt in the auxiliary directory.
In the associated Elements::Program, override defineProgramArguments() as follows:
Public Types | |
using | OptionsDescription = boost::program_options::options_description |
Same alias as Elements::Program::OptionsDescription. | |
using | PositionalOptionsDescription = boost::program_options::positional_options_description |
Same alias as Elements::Program::PositionalOptionsDescription. | |
using | ValueSemantics = boost::program_options::value_semantic |
Shortcut to Boost's class. | |
Public Member Functions | |
~ProgramOptions ()=default | |
Destructor. | |
ProgramOptions (const std::string &helpMessage="") | |
Create option descriptions with help message. More... | |
void | named (const char *name, const ValueSemantics *value, const char *description) |
Add a named option. More... | |
void | positional (const char *name, const ValueSemantics *value, const char *description) |
Add a positional option. More... | |
std::pair< OptionsDescription, PositionalOptionsDescription > | asPair () const |
Get the named and positional option descriptions. More... | |
Static Public Member Functions | |
static ProgramOptions | fromAuxFile (const std::string &helpFile) |
Create option descriptions from help file. More... | |