cmdline icon indicating copy to clipboard operation
cmdline copied to clipboard

this API parse_check(const string arg) not work

Open darkchooselight opened this issue 3 years ago • 0 comments

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

darkchooselight avatar Dec 20 '21 12:12 darkchooselight