Skip to content
This repository was archived by the owner on Aug 22, 2023. It is now read-only.

Invoke arg parse function before checking options #162

Description

@justinedelson

Consider an arg definition like this:

  {
    name: 'something',
    required: true,
    parse: input => input.toUpperCase(),
    options: ['A', 'B'],
  }

Logically an input token of a should be acceptable here because the parse function is provided in order to coerce the lower case value into an upper case value.

This, however, does not work since the token is compared to the options before the parse function is invoked. While in this synthetic case this is easy enough to workaround, in more complex cases it would not be quite so easy.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions