MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / readOption

Function readOption

scripts/validate-release-ref.ts:58–66  ·  view source on GitHub ↗
(args: ReadonlyArray<string>, name: string)

Source from the content-addressed store, hash-verified

56};
57
58const readOption = (args: ReadonlyArray<string>, name: string): string | undefined => {
59 const index = args.indexOf(name);
60 if (index === -1) return undefined;
61 const value = args[index + 1];
62 if (!value || value.startsWith("--")) {
63 throw new Error(`Missing value for ${name}`);
64 }
65 return value;
66};
67
68if (import.meta.main) {
69 run();

Callers 1

runFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected