sindresorhus / meow

🐈 CLI app helper
MIT License
3.53k stars 150 forks source link

Add error when `flag.default` isn't a valid choice #231

Closed tommy-mitchell closed 1 year ago

tommy-mitchell commented 1 year ago
meow({
    flags: {
        number: {
            type: 'number',
            choices: [1, 2, 3],
            default: 1,
        },
    },
});
//=> Throws 'Each value of the option `default` must exist within the option `choices`. Invalid flags: `--number`'