MCPcopy Create free account
hub / github.com/Compaile/ctrack / parseOption

Function parseOption

test/doctest.h:6512–6522  ·  view source on GitHub ↗

parses an option and returns the string after the '=' character

Source from the content-addressed store, hash-verified

6510
6511 // parses an option and returns the string after the '=' character
6512 bool parseOption(int argc, const char* const* argv, const char* pattern, String* value = nullptr,
6513 const String& defaultVal = String()) {
6514 if(value)
6515 *value = defaultVal;
6516#ifndef DOCTEST_CONFIG_NO_UNPREFIXED_OPTIONS
6517 // offset (normally 3 for "dt-") to skip prefix
6518 if(parseOptionImpl(argc, argv, pattern + strlen(DOCTEST_CONFIG_OPTIONS_PREFIX), value))
6519 return true;
6520#endif // DOCTEST_CONFIG_NO_UNPREFIXED_OPTIONS
6521 return parseOptionImpl(argc, argv, pattern, value);
6522 }
6523
6524 // locates a flag on the command line
6525 bool parseFlag(int argc, const char* const* argv, const char* pattern) {

Callers 3

parseFlagFunction · 0.85
parseCommaSepArgsFunction · 0.85
parseIntOptionFunction · 0.85

Calls 1

parseOptionImplFunction · 0.85

Tested by

no test coverage detected