| 90 | } |
| 91 | |
| 92 | std::optional<std::string> find_arg(int argc, char ** argv, const std::string & name) { |
| 93 | record_value_query(name); |
| 94 | for (int i = 1; i + 1 < argc; ++i) { |
| 95 | if (argv[i] == name) { |
| 96 | return std::string(argv[i + 1]); |
| 97 | } |
| 98 | } |
| 99 | return std::nullopt; |
| 100 | } |
| 101 | |
| 102 | bool has_arg(int argc, char ** argv, const std::string & name) { |
| 103 | record_flag_query(name); |
| 104 | for (int i = 1; i < argc; ++i) { |
| 105 | if (argv[i] == name) { |
| 106 | return true; |
| 107 | } |
| 108 | } |
| 109 | return false; |
| 110 | } |
| 111 | |
| 112 | std::vector<std::string> collect_args(int argc, char ** argv, const std::string & name) { |
no outgoing calls
no test coverage detected