MCPcopy Create free account
hub / github.com/EmbeddedRPC/erpc / isOption

Function isOption

erpcgen/src/options.cpp:321–325  ·  view source on GitHub ↗

See if an argument is an option

Source from the content-addressed store, hash-verified

319
320// See if an argument is an option
321inline static int isOption(unsigned flags, const char *arg)
322{
323 return ((arg != nullptr) && ((*arg != '\0') || (arg[1] != '\0')) &&
324 ((*arg == '-') || ((flags & static_cast<signed>(Options::OptCtrl::PLUS)) && (*arg == '+'))));
325}
326
327// See if we should be parsing only options or if we also need to
328// parse positional arguments

Callers 3

parse_optMethod · 0.85
parse_longoptMethod · 0.85
operator()Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected