| 104 | } |
| 105 | |
| 106 | int FindArg(const char *which) { |
| 107 | if (which == nullptr) |
| 108 | return 0; |
| 109 | |
| 110 | auto which_matches = [which = SkipArgPrefix(which)](char *arg) -> bool { |
| 111 | return strcasecmp(which, SkipArgPrefix(arg)) == 0; |
| 112 | }; |
| 113 | |
| 114 | for (int i = 1; i <= TotalArgs; i++) { |
| 115 | if (which_matches(GameArgs[i])) { |
| 116 | mprintf(0, "FindArg: Found [%s] at argument index (%d).", which, i); |
| 117 | return i; |
| 118 | } |
| 119 | } |
| 120 | |
| 121 | mprintf(0, "FindArg: Did not find [%s] on command line.", which); |
| 122 | return 0; |
| 123 | } |
| 124 | |
| 125 | // Returns index of argument sought, or 0 if not found |
| 126 | int FindArgChar(const char *which, char singleCharArg) { |
no test coverage detected