| 702 | |
| 703 | |
| 704 | std::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 | |
| 727 | int SingleCommand::RunCommand(const std::string &arg0, unsigned int skip, int argc, char **argv) |
no test coverage detected