(
args: string[],
flagsSpecification?: T,
parserOptions: ParserOptions = {}
)
| 40 | * - `flags` previously these keys were mixed with the positional arguments |
| 41 | */ |
| 42 | export 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 | } |
no outgoing calls
no test coverage detected