MCPcopy Create free account
hub / github.com/OpenVPN/openvpn3-linux / getopt_optstring

Method getopt_optstring

src/common/cmdargparser.cpp:480–504  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

478
479
480std::string SingleCommandOption::getopt_optstring()
481{
482 if (0 == shortopt)
483 {
484 return "";
485 }
486
487 std::stringstream ret;
488 ret << shortopt;
489
490 switch (getopt_option.has_arg)
491 {
492 case optional_argument:
493 ret << ":";
494 // The fall-through is by design.
495 // optional arguments should have two colons
496 case required_argument:
497 ret << ":";
498 break;
499 default:
500 break;
501 }
502
503 return ret.str();
504}
505
506
507bool SingleCommandOption::check_short_option(const char o)

Callers 1

init_getoptMethod · 0.80

Calls 1

strMethod · 0.45

Tested by

no test coverage detected