diff --git a/examples/corsika.cpp b/examples/corsika.cpp index 078b9d2be23c4332d59df0009ae86597946e6819..09e024287b619b0f39accbfcc59e284ec8b9a10a 100644 --- a/examples/corsika.cpp +++ b/examples/corsika.cpp @@ -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") { diff --git a/examples/mars.cpp b/examples/mars.cpp index 0a9d7610ba072bc5b3dc2ea9539351f37e3e9f9d..73ca6fbf900457a8791229b9dcbd8a9efc8b7264 100644 --- a/examples/mars.cpp +++ b/examples/mars.cpp @@ -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") {