MCPcopy Index your code
hub / github.com/di-sukharev/opencommit / stripOcoFlags

Function stripOcoFlags

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

Source from the content-addressed store, hash-verified

27const OCO_EQUALS_PREFIXES = ['-c=', '--context=', '-y=', '--yes=', '--fgm='];
28
29const stripOcoFlags = (argv: string[]): string[] => {
30 const out: string[] = [];
31 for (let i = 0; i < argv.length; i++) {
32 const a = argv[i];
33 // String flags with a separate value token: -c <val>, --context <val>
34 if (OCO_FLAGS_WITH_VALUE.has(a)) {
35 i++; // skip the value token too
36 continue;
37 }
38 // Boolean flags: -y, --yes, --fgm
39 if (OCO_BOOLEAN_FLAGS.has(a)) {
40 continue;
41 }
42 // Equals form: -c=…, --context=…, -y=…, --yes=…, --fgm=…
43 if (OCO_EQUALS_PREFIXES.some((prefix) => a.startsWith(prefix))) {
44 continue;
45 }
46 out.push(a);
47 }
48 return out;
49};
50
51const rawArgv = process.argv.slice(2);
52const extraArgs = stripOcoFlags(rawArgv);

Callers 1

cli.tsFile · 0.70

Calls 3

startsWithMethod · 0.80
hasMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…