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

Function parseArgument

scripts/changelog-weekly.ts:119–133  ·  view source on GitHub ↗
(args: string[], index: number, parsed: MutableWeeklyOptions)

Source from the content-addressed store, hash-verified

117}
118
119function parseArgument(args: string[], index: number, parsed: MutableWeeklyOptions) {
120 const arg = args[index];
121 if (arg === "--help" || arg === "-h") {
122 printUsage();
123 process.exit(0);
124 }
125
126 return parseMappedArgument(args, index, parsed, {
127 inlineValueOptions: INLINE_VALUE_OPTIONS,
128 valueOptions: VALUE_OPTIONS,
129 booleanOptions: BOOLEAN_OPTIONS,
130 parsePositional: (positional) => fail(`Unexpected positional argument: ${positional}`),
131 fail,
132 });
133}
134
135function finalizeOptions(parsed: MutableWeeklyOptions): WeeklyOptions {
136 const { from, to } = requireDateRange(parsed);

Callers 1

parseWeeklyOptionsFunction · 0.70

Calls 3

parseMappedArgumentFunction · 0.90
printUsageFunction · 0.70
failFunction · 0.70

Tested by

no test coverage detected