sindresorhus / meow

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

isMultiple is still required when isRequired fn returns false #193

Closed softwarewright closed 3 years ago

softwarewright commented 3 years ago

Example:

const cli = meow({
    importMeta: import.meta,
    description: "Custom description",
    help: `
        Usage
          foo <input>
  `,
    flags: {
        test: {
            type: "number",
            alias: "t",
            isRequired: () => false,
            isMultiple: true,
        },
    },
});

console.log(cli.flags.test);

should return []

but instead returns

Missing required flag
        --test, -t
softwarewright commented 3 years ago

I put up a PR fix here: https://github.com/sindresorhus/meow/pull/194