|
lintel 0.2.0
|
#include <Argument.h>
Public Types | |
| typedef std::variant< int32_t *, uint32_t *, double *, float *, bool *, std::string *, std::optional< int32_t > *, std::optional< uint32_t > *, std::optional< double > *, std::optional< float > *, std::optional< bool > *, std::optional< std::string > * > | Value |
Public Member Functions | |
| Argument (std::string flag, std::string shortFlag, std::string description, const Value &value) | |
| void | printHelp (std::ostream &os=std::cout) const |
| void | parse (const std::string &arguments) |
| const std::string & | getFlag () const |
| const std::string & | getShortFlag () const |
Represents a single command-line argument with flag, short flag, description, and parsed value.
| typedef std::variant<int32_t *, uint32_t *, double *, float *, bool *, std::string *, std::optional<int32_t> *, std::optional<uint32_t> *, std::optional<double> *, std::optional<float> *, std::optional<bool> *, std::optional<std::string> *> lintel::Argument::Value |
| lintel::Argument::Argument | ( | std::string | flag, |
| std::string | shortFlag, | ||
| std::string | description, | ||
| const Value & | value | ||
| ) |
Construct an Argument with its flags, description, and target value.
| flag | the long flag name (e.g. "--verbose") |
| shortFlag | the short flag name (e.g. "-v") |
| description | the help description |
| value | pointer to the variable to store the parsed value |
| const std::string & lintel::Argument::getFlag | ( | ) | const |
Returns the long flag name.
| const std::string & lintel::Argument::getShortFlag | ( | ) | const |
Returns the short flag name.
Parse a command-line argument string and store the result.
| arguments | the argument string to parse |
| void lintel::Argument::printHelp | ( | std::ostream & | os = std::cout | ) | const |
Print the help text for this argument to the given stream.
| os | the output stream (default: std::cout) |