Skip to content

Add Option/Command from hash? #1359

@shadowspawn

Description

@shadowspawn

Are authors interested in a factory method to construct commands or options from a hash of the properties? This would be an alternative approach rather than a replacement for the current chaining interface. The use case is adding options and commands from meta information supplied from elsewhere.

e.g.

const my = readOption();
const myOption = Option.fromHash({ flags: my.flags, description: my.description, mandatory: my.mandatory, hidden: my.hidden });
program.addOption(myOption)

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions