MCPcopy Create free account
hub / github.com/heygen-com/hyperframes / readNextArg

Function readNextArg

scripts/cli-options.ts:139–150  ·  view source on GitHub ↗
(
  args: string[],
  index: number,
  flag: string,
  fail: (message: string) => never,
)

Source from the content-addressed store, hash-verified

137}
138
139export function readNextArg(
140 args: string[],
141 index: number,
142 flag: string,
143 fail: (message: string) => never,
144) {
145 const value = args[index + 1];
146 if (!value || value.startsWith("--")) {
147 fail(`Missing value for ${flag}`);
148 }
149 return value;
150}
151
152export function validateCliVersion(
153 version: string,

Callers 1

Calls 1

failFunction · 0.70

Tested by

no test coverage detected