MCPcopy Create free account
hub / github.com/discountry/ritmex-bot / parseCommonOptions

Function parseCommonOptions

src/cli/command-parser.ts:309–324  ·  view source on GitHub ↗
(options: Record<string, string | boolean>)

Source from the content-addressed store, hash-verified

307}
308
309function 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
326function parseOptionBag(args: string[]): ParsedOptionBag {
327 const options: Record<string, string | boolean> = {};

Callers 2

parseCommandArgvFunction · 0.85
parseHelpCommandFunction · 0.85

Calls 4

readStringOptionFunction · 0.85
readBooleanOptionFunction · 0.85
readNumberOptionFunction · 0.85
normalizeExchangeFunction · 0.85

Tested by

no test coverage detected