(options: Record<string, string | boolean>)
| 307 | } |
| 308 | |
| 309 | function parseCommonOptions(options: Record<string, string | boolean>): CommandCommonOptions & { help?: boolean } { |
| 310 | const exchangeRaw = readStringOption(options, ["exchange"]); |
| 311 | const symbol = readStringOption(options, ["symbol"]); |
| 312 | const json = readBooleanOption(options, ["json"], false); |
| 313 | const dryRun = readBooleanOption(options, ["dry-run"], false); |
| 314 | const timeoutMs = readNumberOption(options, ["timeout"]) ?? DEFAULT_TIMEOUT_MS; |
| 315 | const help = readBooleanOption(options, ["help"], false); |
| 316 | return { |
| 317 | exchange: normalizeExchange(exchangeRaw), |
| 318 | symbol: symbol?.trim() || undefined, |
| 319 | json, |
| 320 | dryRun, |
| 321 | timeoutMs, |
| 322 | help, |
| 323 | }; |
| 324 | } |
| 325 | |
| 326 | function parseOptionBag(args: string[]): ParsedOptionBag { |
| 327 | const options: Record<string, string | boolean> = {}; |
no test coverage detected