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

Method CallArgumentHelper

src/common/cmdargparser.cpp:704–724  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

702
703
704std::string SingleCommand::CallArgumentHelper(const std::string &option_name)
705{
706 for (auto const &opt : options)
707 {
708 // Strip any trailing '=' for the long option check.
709 // Options with optional arguments always has a '=' to provide a value
710 auto pos = option_name.rfind("=");
711 std::string o = (pos != std::string::npos ? option_name.substr(0, pos) : option_name);
712
713 if (1 == option_name.size()
714 && opt->check_short_option(option_name[0]))
715 {
716 return opt->call_argument_helper_callback(option_name);
717 }
718 else if (opt->check_long_option(o.c_str()))
719 {
720 return opt->call_argument_helper_callback(option_name);
721 }
722 }
723 return "";
724}
725
726
727int SingleCommand::RunCommand(const std::string &arg0, unsigned int skip, int argc, char **argv)

Callers 1

call_arg_helperMethod · 0.80

Calls 4

sizeMethod · 0.80
check_short_optionMethod · 0.80
check_long_optionMethod · 0.80

Tested by

no test coverage detected