Skip to content

this API parse_check(const string arg) not work #28

Description

@darkchooselight

my example code is follow:
’‘’
cmdline::parser parser;
parser.add("loglevel", 'l', "0-critical, 1-err, 2-warn, 3-info, 4-debug, 5-trace", false, 1);
parser.parse_check("--loglevel");
auto t = parser.get("loglevel");
std::cout << "level:" << t << std::endl; // when set loglevel 5, but it always default value effect
auto log_level = (LogLevel)t;
std::cout << "log level: " << log_level <<std::endl;
InitLog(log_level);
testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
‘’‘

I built a bin as "test", when I execute the command "./test --gtest_filter=*.test1 --loglevel 5",
but the loglevel is always set to be default value 1
image

please check this problem, thx

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions