SB++
Sandbox applications
Loading...
Searching...
No Matches
arg Namespace Reference

A general purpose, flexible command-line argument handler. This file includes definitions to create a powerful command-line argument handler. --switches and -s formatting is supported, as is specifying multiple short-switches together a la -vvu. Additionally, lists are supported, and values can be provided either with an = key, a space, or with multiple invocations of the switch for lists. Support for mandatory arguments is also supported. Additionally, modifier tags and lambdas can extend argument functionality tremendously. More...

Data Structures

class  Arg
 A command-line argument. More...
 
struct  config
 

Typedefs

typedef struct arg::config config
 

Enumerations

enum struct  custom_policy { FALSE , TRUE , MODIFIABLE }
 

Functions

void parse_args ()
 Parse command line arguments.
 
Argat (const std::string &key)
 
const std::string & get (const std::string &key)
 
void emplace (const std::string &key, const std::string &val)
 
const std::string & mod (const std::string &key)
 
uint_fast8_t level (const std::string &key)
 
const shared::set & list (const std::string &key)
 
const shared::set & valid (const std::string &key)
 
const bool & is_list (const std::string &key)
 
std::vector< std::pair< std::string, std::string > > modlist (const std::string &key)
 

Variables

vector unknown = {}
 
vector args
 
std::string hash = ""
 
std::map< std::string, arg::Argswitches
 

Detailed Description

A general purpose, flexible command-line argument handler. This file includes definitions to create a powerful command-line argument handler. --switches and -s formatting is supported, as is specifying multiple short-switches together a la -vvu. Additionally, lists are supported, and values can be provided either with an = key, a space, or with multiple invocations of the switch for lists. Support for mandatory arguments is also supported. Additionally, modifier tags and lambdas can extend argument functionality tremendously.

Typedef Documentation

◆ config

typedef struct arg::config arg::config

Arguments passed to Argument.