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

Function parseVersionPositionalArg

scripts/cli-options.ts:124–137  ·  view source on GitHub ↗
(
  arg: string,
  currentVersion: string | undefined,
  fail: (message: string) => never,
)

Source from the content-addressed store, hash-verified

122}
123
124export function parseVersionPositionalArg(
125 arg: string,
126 currentVersion: string | undefined,
127 fail: (message: string) => never,
128) {
129 if (arg.startsWith("--")) {
130 fail(`Unknown option: ${arg}`);
131 }
132 if (currentVersion) {
133 fail(`Unexpected positional argument: ${arg}`);
134 }
135
136 return arg.replace(/^v/, "");
137}
138
139export function readNextArg(
140 args: string[],

Callers 1

parseVersionOrHelpFunction · 0.85

Calls 1

failFunction · 0.70

Tested by

no test coverage detected