addOption isRequired/choices not working
martin-braun opened this issue · comments
program
.command("open", "Opens a foo.")
.addOption(
new Option({
flags: "-f --foo",
description: "Open something",
isRequired: true,
choices: ["a", "b", "c"],
})
)
.action(async () => {
console.log(program.foo);
});
Testing:
> ./my-test.ts open
undefined
> ./my-test.ts open -f d
d
In both cases it should complain that either -f
is missing or d
is not a valid choice. This doesn't work.