Arkanjo 0.2
A tool for find code duplicated functions in codebases
Loading...
Searching...
No Matches
parser_options.cpp File Reference
#include <arkanjo/cli/parser_options.hpp>
#include <iostream>
#include <memory>
+ Include dependency graph for parser_options.cpp:

Go to the source code of this file.

Functions

std::string build_shortopts (const std::vector< CliOption > &options)
 
bool parse_options (int argc, char *argv[], const std::vector< CliOption > &options, ParsedOptions &ctx_options)
 Analyzes command-line arguments and populates ParsedOptions.
 

Function Documentation

◆ build_shortopts()

std::string build_shortopts ( const std::vector< CliOption > & options)

Definition at line 26 of file parser_options.cpp.

◆ 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
argcNumber of arguments passed to the application.
argvVector of strings containing the arguments.
optionsArray of CliOption containing the options.
ctx_optionsReference to ParsedOptions that will be filled in.

Definition at line 45 of file parser_options.cpp.