Represents a command line option.
More...
#include <dccl/cli_option.h>
|
| Option (char shortname, const char *longname, int has_argument, std::string description) |
| Create a command line option. More...
|
|
option | c_opt () const |
|
std::string | opt_code () const |
|
std::string | usage () const |
|
|
static void | convert_vector (const std::vector< Option > &options, std::vector< option > *c_options, std::string *opt_string) |
| Convert a vector of Options into a vector of options (from getopt.h) and an opt_string, suitable for use in getopt_long()
|
|
Represents a command line option.
Definition at line 36 of file cli_option.h.
◆ Option()
dccl::Option::Option |
( |
char |
shortname, |
|
|
const char * |
longname, |
|
|
int |
has_argument, |
|
|
std::string |
description |
|
) |
| |
|
inline |
Create a command line option.
- Parameters
-
shortname | Single character representation (e.g. 'v' for "-v") |
longname | Full representation (e.g. "verbose" for "--verbose") |
has_argument | Does the parameter take an argument? |
description | Human description for the –help option |
Definition at line 45 of file cli_option.h.
◆ c_opt()
option dccl::Option::c_opt |
( |
| ) |
const |
|
inline |
- Returns
- Equivalent option from <getopt.h>
Definition at line 56 of file cli_option.h.
◆ opt_code()
std::string dccl::Option::opt_code |
( |
| ) |
const |
|
inline |
- Returns
- option code from <getopt.h> used in getopt_long()
Definition at line 59 of file cli_option.h.
◆ usage()
std::string dccl::Option::usage |
( |
| ) |
const |
|
inline |
- Returns
- String giving usage for the –help option.
Definition at line 77 of file cli_option.h.
The documentation for this class was generated from the following file: