(args: string[], index: number, parsed: MutableWeeklyOptions)
| 117 | } |
| 118 | |
| 119 | function 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 | |
| 135 | function finalizeOptions(parsed: MutableWeeklyOptions): WeeklyOptions { |
| 136 | const { from, to } = requireDateRange(parsed); |
no test coverage detected