sindresorhus / meow

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

Choices? #237

Closed joshuavachon25 closed 1 year ago

joshuavachon25 commented 1 year ago

I'm currently using meow 11.0.0 to make a CLI and I saw in the doc that we could user choices with the flag to limit valid values, but it doesn't work. Is it an old functionnality?

Example: If I try: unicorn -r -e cat I won't get an error even if cat is not in the choices.

Code:

env: {
            type: 'string',
            choices: ['dev', 'int'],
            alias: 'e',
            isMultiple: true,
            isRequired: (flags) => {
                if (flags.run) {
                    return true;
                }
                return false;
            }
        },
sindresorhus commented 1 year ago

The option is not released yet. The readme reflects the main branch, not the latest version.

joshuavachon25 commented 1 year ago

Thanks!