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

Method get_option_list_prefixed

src/common/cmdargparser.cpp:423–457  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

421
422
423std::string SingleCommandOption::get_option_list_prefixed()
424{
425 std::stringstream r;
426
427 if (0 != shortopt)
428 {
429 r << "-" << shortopt;
430 }
431 if (!longopt.empty())
432 {
433 if (r.tellp() != std::streampos(0))
434 {
435 r << " ";
436 }
437 r << "--" << longopt;
438
439 if (optional_argument == getopt_option.has_arg)
440 {
441 r << " --" << longopt << "=";
442 }
443 }
444 if (!alias.empty())
445 {
446 if (r.tellp() != std::streampos(0))
447 {
448 r << " ";
449 }
450 r << "--" << alias;
451 if (optional_argument == getopt_alias.has_arg)
452 {
453 r << " --" << alias << "=";
454 }
455 }
456 return r.str();
457}
458
459
460std::string SingleCommandOption::call_argument_helper_callback(const std::string &opt_name)

Callers 1

GetOptionsListMethod · 0.80

Calls 2

emptyMethod · 0.45
strMethod · 0.45

Tested by

no test coverage detected