Hyperiso 1.0.3
Modular flavour-physics calculations, Wilson coefficients and statistical inference
Loading...
Searching...
No Matches
CliOptions Struct Reference

Small command-line parser for the Hyperiso terminal interface. More...

#include <CliUtils.h>

Public Member Functions

bool has (const std::string &key) const
 
std::string get (const std::string &key, const std::string &fallback="") const
 
int get_int (const std::string &key, int fallback) const
 
double get_double (const std::string &key, double fallback) const
 
bool flag (const std::string &key, bool fallback=false) const
 
std::vector< std::string > list (const std::string &key, const std::vector< std::string > &fallback={}) const
 

Static Public Member Functions

static CliOptions parse (int argc, char *argv[], int first=1)
 

Public Attributes

std::vector< std::string > positionals
 
std::map< std::string, std::vector< std::string > > options
 

Detailed Description

Small command-line parser for the Hyperiso terminal interface.

The interface deliberately keeps parsing simple: options are passed as --key value, --key=value or boolean flags. Comma-separated values are handled by list(). This avoids the heavy historical parser and makes CLI handlers easy to read and maintain.

Definition at line 21 of file CliUtils.h.

Member Function Documentation

◆ flag()

bool CliOptions::flag ( const std::string &  key,
bool  fallback = false 
) const

Definition at line 82 of file CliUtils.cpp.

◆ get()

std::string CliOptions::get ( const std::string &  key,
const std::string &  fallback = "" 
) const

Definition at line 66 of file CliUtils.cpp.

◆ get_double()

double CliOptions::get_double ( const std::string &  key,
double  fallback 
) const

Definition at line 77 of file CliUtils.cpp.

◆ get_int()

int CliOptions::get_int ( const std::string &  key,
int  fallback 
) const

Definition at line 72 of file CliUtils.cpp.

◆ has()

bool CliOptions::has ( const std::string &  key) const

Definition at line 62 of file CliUtils.cpp.

◆ list()

std::vector< std::string > CliOptions::list ( const std::string &  key,
const std::vector< std::string > &  fallback = {} 
) const

Definition at line 88 of file CliUtils.cpp.

◆ parse()

CliOptions CliOptions::parse ( int  argc,
char *  argv[],
int  first = 1 
)
static

Definition at line 32 of file CliUtils.cpp.

Member Data Documentation

◆ options

std::map<std::string, std::vector<std::string> > CliOptions::options

Definition at line 23 of file CliUtils.h.

◆ positionals

std::vector<std::string> CliOptions::positionals

Definition at line 22 of file CliUtils.h.


The documentation for this struct was generated from the following files: