|
Hyperiso 1.0.3
Modular flavour-physics calculations, Wilson coefficients and statistical inference
|
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 |
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.
| bool CliOptions::flag | ( | const std::string & | key, |
| bool | fallback = false |
||
| ) | const |
Definition at line 82 of file CliUtils.cpp.
| std::string CliOptions::get | ( | const std::string & | key, |
| const std::string & | fallback = "" |
||
| ) | const |
Definition at line 66 of file CliUtils.cpp.
| double CliOptions::get_double | ( | const std::string & | key, |
| double | fallback | ||
| ) | const |
Definition at line 77 of file CliUtils.cpp.
| int CliOptions::get_int | ( | const std::string & | key, |
| int | fallback | ||
| ) | const |
Definition at line 72 of file CliUtils.cpp.
| bool CliOptions::has | ( | const std::string & | key | ) | const |
Definition at line 62 of file CliUtils.cpp.
| 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.
|
static |
Definition at line 32 of file CliUtils.cpp.
| std::map<std::string, std::vector<std::string> > CliOptions::options |
Definition at line 23 of file CliUtils.h.
| std::vector<std::string> CliOptions::positionals |
Definition at line 22 of file CliUtils.h.