#include <optional>
#include <string>
#include <map>
#include <vector>
#include <getopt.h>
#include <arkanjo/cli/cli_error.hpp>
Go to the source code of this file.
◆ OPTION_END
| #define OPTION_END {nullptr, 0, NoArgument, nullptr} |
◆ ArgumentsType
| Enumerator |
|---|
| NoArgument | |
| RequiredArgument | |
| OptionalArgument | |
| PositionalArgument | |
Definition at line 10 of file parser_options.hpp.
◆ parse_options()
| bool parse_options |
( |
int |
argc, |
|
|
char * |
argv[], |
|
|
const std::vector< CliOption > & |
options, |
|
|
ParsedOptions & |
ctx_options |
|
) |
| |
Analyzes command-line arguments and populates ParsedOptions.
It supports short (-c) and long (–config) options. Flags without arguments receive the value "true". Arguments that are not options are added to extra_args.
- Parameters
-
| argc | Number of arguments passed to the application. |
| argv | Vector of strings containing the arguments. |
| options | Array of CliOption containing the options. |
| ctx_options | Reference to ParsedOptions that will be filled in. |
Definition at line 45 of file parser_options.cpp.