Skip to content

Feature request - looking for enum #33

@ORESoftware

Description

@ORESoftware

Here are all options for an argument (as listed in docs):

{
    names: ['file', 'f'],       // Required (one of `names` or `name`).
    type: 'string',             // Required.
    completionType: 'filename',
    env: 'MYTOOL_FILE',
    help: 'Config file to load before running "mytool"',
    helpArg: 'PATH',
    helpWrap: false,
    default: path.resolve(process.env.HOME, '.mytoolrc')
}

I am looking for an enum option, so I can use it like so:

{
  names: ['signal','s']
  type: 'string',
  enum: ['SIGINT', 'SIGTERM', 'SIGKILL']     // <<<<<<<< here
}

I can handle that in my code, but it would be nice if dashdash could do that!

thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions