MCPcopy Create free account
hub / github.com/clice-io/clice / parse_first

Function parse_first

tests/unit/command/argument_parser_tests.cpp:12–19  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10TEST_SUITE(ArgumentParser) {
11
12unsigned parse_first(std::vector<std::string> args) {
13 for(auto& result: option::table().parse(args)) {
14 if(result.has_value()) {
15 return result->id;
16 }
17 }
18 return OPT_INVALID;
19}
20
21TEST_CASE(ParseOptionID) {
22 ASSERT_EQ(parse_first({"-g"}), OPT_g_Flag);

Callers 1

TEST_CASEFunction · 0.85

Calls 1

parseMethod · 0.45

Tested by

no test coverage detected