UNPKG

@tsed/cli-core

Version:
15 lines (14 loc) 477 B
export function mapCommanderOptions(commandName, commands) { const options = {}; commands.forEach((command) => { if (command.name() !== commandName) { return; } Object.entries(command.opts()) .filter(([key]) => !key.startsWith("_") && !["commands", "options", "parent", "rawArgs", "args"].includes(key)) .forEach(([key, value]) => { options[key] = value; }); }); return options; }