(tokens: string[], commandName: string)
| 166 | } |
| 167 | |
| 168 | function collectNonFlagOperands(tokens: string[], commandName: string) { |
| 169 | const operands: string[] = []; |
| 170 | for (let index = 1; index < tokens.length; index += 1) { |
| 171 | const token = tokens[index]; |
| 172 | if (isOptionToken(token)) { |
| 173 | if (commandName === "rg" && RG_FLAGS_WITH_VALUES.has(token)) { |
| 174 | index += 1; |
| 175 | } |
| 176 | continue; |
| 177 | } |
| 178 | operands.push(token); |
| 179 | } |
| 180 | return operands; |
| 181 | } |
| 182 | |
| 183 | function findPathTokens(tokens: string[]) { |
| 184 | const commandName = tokens[0]?.toLowerCase() ?? ""; |
no test coverage detected