-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug: Invalid option choice! with multiple required options that have predefined choices #50
Comments
Ok moving |
It's probably, because |
Facing the same issue here. The validation process does not work when using the import Denomander, { Option } from "https://deno.land/x/denomander/mod.ts";
const program = new Denomander({
app_name: "Organisation manager",
app_description: "Manage organisations.",
app_version: "1.0.0",
});
const countries = new Option({
flags: "-c --country",
description: "Define country for which the number should be purchased.",
}).choices(["NL", "US"]);
const email = new Option({
flags: "-e --email",
description: "Define the email of owner.",
}).isRequired(true);
program
.command("create-org", "Creates a new organisation.")
.addOption(email)
.addOption(countries)
.action(({ args }: any) => {
console.log(args);
});
program.parse(Deno.args); 1. Error when running the script deno run cli/organisation.ts create-org -e "[email protected]" -c "NL"
❌ Error (e): Invalid option choice! Argument '[email protected]' is invalid. Allowed choices are: NL,US 2. Error with the help, does not show required parameters deno run cli/organisation.ts create-org --help
Command Usage:
create-org {options}
Description:
Creates a new organisation.
Options:
-c --country Define country for which the number should be purchased. (choices: NL,US)
-e --email Define the email of owner.
-h --help Help Screen
|
Hi, I have two mandatory actions, but Denomander seems to get confused about what the right choices are, it mixes things up. Did I find a bug?
@siokas Am I missing something?
The text was updated successfully, but these errors were encountered: