MCPcopy Index your code
hub / github.com/getsentry/XcodeBuildMCP / findTopLevelCommand

Function findTopLevelCommand

src/cli.ts:12–38  ·  view source on GitHub ↗
(argv: string[])

Source from the content-addressed store, hash-verified

10import { hydrateSentryDisabledEnvFromProjectConfig } from './utils/sentry-config.ts';
11
12function findTopLevelCommand(argv: string[]): string | undefined {
13 const flagsWithValue = new Set([
14 '--socket',
15 '--log-level',
16 '--style',
17 '--file-path-render-style',
18 ]);
19 let skipNext = false;
20
21 for (const token of argv) {
22 if (skipNext) {
23 skipNext = false;
24 continue;
25 }
26
27 if (token.startsWith('-')) {
28 if (flagsWithValue.has(token)) {
29 skipNext = true;
30 }
31 continue;
32 }
33
34 return token;
35 }
36
37 return undefined;
38}
39
40function findGlobalSocketOverride(argv: string[]): string | undefined {
41 for (let index = 0; index < argv.length; index += 1) {

Callers 2

mainFunction · 0.85
cli.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected