Skip to content

Conversation

istandre
Copy link
Contributor

@istandre istandre commented May 3, 2023

Fixes #239
This fixes the validation of the default values.

Example:

meow({
	importMeta,
	flags: {
		string: {
			type: 'string',
			choices: ['dog', 'cat', 'unicorn'],
			default: 'unicorn',
		},
	},
});

should not throw an error, since 'unicorn' exists within the option choices.

But instead, it throws the following error:

Each value of the option `default` must exist within the option `choices`. Invalid flags: `--string`.

@sindresorhus sindresorhus merged commit c3bf62b into sindresorhus:main May 4, 2023
@sindresorhus
Copy link
Owner

Thanks :)

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

Successfully merging this pull request may close these issues.

flag.default values validation is faulty
2 participants