MCPcopy
hub / github.com/Dimillian/CodexMonitor / collectNonFlagOperands

Function collectNonFlagOperands

src/utils/threadItems.explore.ts:168–181  ·  view source on GitHub ↗
(tokens: string[], commandName: string)

Source from the content-addressed store, hash-verified

166}
167
168function 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
183function findPathTokens(tokens: string[]) {
184 const commandName = tokens[0]?.toLowerCase() ?? "";

Callers 2

findPathTokensFunction · 0.85
parseSearchFunction · 0.85

Calls 1

isOptionTokenFunction · 0.85

Tested by

no test coverage detected