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

Invoke arg parse function before checking options #162

Open
justinedelson opened this issue Mar 1, 2021 · 0 comments · May be fixed by #163
Open

Invoke arg parse function before checking options #162

justinedelson opened this issue Mar 1, 2021 · 0 comments · May be fixed by #163

Comments

@justinedelson
Copy link

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant