IAP GITLAB

Skip to content
Snippets Groups Projects
Commit a995ef0d authored by ralfulrich's avatar ralfulrich Committed by Ralf Ulrich
Browse files

cli default value handling

parent 5db5e069
No related branches found
No related tags found
No related merge requests found
......@@ -156,7 +156,8 @@ int main(int argc, char** argv) {
// parse the command line options into the variables
CLI11_PARSE(app, argc, argv);
string const loglevel = app["verbosity"]->as<string>();
string const loglevel =
(app.count("--verbosity") ? app["verbosity"]->as<string>() : "info");
if (loglevel == "warn") {
logging::set_level(logging::level::warn);
} else if (loglevel == "info") {
......
......@@ -184,7 +184,8 @@ int main(int argc, char** argv) {
// parse the command line options into the variables
CLI11_PARSE(app, argc, argv);
string const loglevel = app["verbosity"]->as<string>();
string const loglevel =
(app.count("--verbosity") ? app["verbosity"]->as<string>() : "info");
if (loglevel == "warn") {
logging::set_level(logging::level::warn);
} else if (loglevel == "info") {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment