MCPcopy Create free account
hub / github.com/vercel/vercel / parseArguments

Function parseArguments

packages/cli/src/util/get-args.ts:42–57  ·  view source on GitHub ↗
(
  args: string[],
  flagsSpecification?: T,
  parserOptions: ParserOptions = {}
)

Source from the content-addressed store, hash-verified

40 * - `flags` previously these keys were mixed with the positional arguments
41 */
42export function parseArguments<T extends arg.Spec>(
43 args: string[],
44 flagsSpecification?: T,
45 parserOptions: ParserOptions = {}
46) {
47 // currently parseArgument (and arg as a whole) will hang
48 // if there are cycles in the flagsSpecification
49 const { _: positional, ...rest } = arg(
50 Object.assign({}, getCommonArgs(), flagsSpecification),
51 {
52 ...parserOptions,
53 argv: args,
54 }
55 );
56 return { args: positional, flags: rest as Prettify<typeof rest> };
57}

Callers 15

parseInitialArgsFunction · 0.90
mainFunction · 0.90
purgeFunction · 0.90
dangerouslyDeleteFunction · 0.90
invalidateFunction · 0.90
logsFunction · 0.90
index.tsFile · 0.90
mainFunction · 0.90
listCmdFunction · 0.90
updateCmdFunction · 0.90
itemsCmdFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected