MCPcopy
hub / github.com/QwikDev/qwik / getArg

Method getArg

packages/qwik/src/cli/utils/app-command.ts:53–65  ·  view source on GitHub ↗
(name: string)

Source from the content-addressed store, hash-verified

51 }
52
53 getArg(name: string): string | undefined {
54 const key = `--${name}`;
55 const matcher = new RegExp(`^${key}($|=)`);
56 const index = this.args.findIndex((arg) => matcher.test(arg));
57 if (index === -1) {
58 return;
59 }
60
61 if (this.args[index].includes('=')) {
62 return this.args[index].split('=')[1];
63 }
64 return this.args[index + 1];
65 }
66}

Callers 2

runBuildCommandFunction · 0.80
runAddInteractiveFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected