![]() |
Scarab
v2.2.3
Project 8 C++ Utility Library
|
Primary application class. More...
#include <application.hh>
Public Member Functions | |
main_app () | |
virtual | ~main_app () |
virtual void | pre_callback () |
void | set_version (version_semantic *a_ver) |
mv_referrable (param_node, master_config) | |
mv_referrable (param_node, default_config) | |
mv_referrable_const (std::string, config_filename) | |
mv_accessible (unsigned, global_verbosity) | |
mv_referrable (param_node, nonoption_kw_args) | |
mv_referrable (param_array, nonoption_ord_args) | |
mv_referrable (param_node, app_options) | |
Primary application class.
See CLI11 documentation for the CLI::App class: - GitHub Readme: https://github.com/CLIUtils/CLI11 - Tutorial: https://cliutils.gitlab.io/CLI11Tutorial - API: https://cliutils.github.io/CLI11/index.html Basic usage (customized from CLI11's basic usage): int main( int argc, char **argv ) { main_app the_main;
Add new options/flags here
Set the default config file the_main.default_config() = t_default_config;
This includes calling application::pre_callback() to finalize the global config CLI11_PARSE( the_main, argc, argv );
return 0; }
Notes for setting options in an application:
Stages for setting the configuration
In stage 3, arguments can have two forms:
nonoption_kw_args
nonoption_ord_args
Application specified options are merged with the config and are separately accessible as app_options
.
Example: > my_app -c config.yaml –an_opt 20 nested.value="hello"
What happens:
config.yaml
will be parsed and merged with the defaultsnested { value: "hello" }
will be merged with the configan_opt
will set something specified in the config to 20 Definition at line 78 of file application.hh.
main_app | ( | ) |
Definition at line 21 of file application.cc.
|
virtual |
Definition at line 44 of file application.cc.
mv_accessible | ( | unsigned | , |
global_verbosity | |||
) |
mv_referrable | ( | param_node | , |
master_config | |||
) |
mv_referrable | ( | param_node | , |
default_config | |||
) |
mv_referrable | ( | param_node | , |
nonoption_kw_args | |||
) |
mv_referrable | ( | param_array | , |
nonoption_ord_args | |||
) |
mv_referrable | ( | param_node | , |
app_options | |||
) |
mv_referrable_const | ( | std::string | , |
config_filename | |||
) |
|
virtual |
parses positional arguments into the global config called after parsing, before running callbacks
Definition at line 53 of file application.cc.
void set_version | ( | version_semantic * | a_ver | ) |
Definition at line 48 of file application.cc.