-
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
Command throws error when parsing number #22
Comments
Hi. Thanks for pointing out. It is a bug. I am working on it! |
Ok I fixed the first one. As for the second (option parsing) I think there is no bug there. program.globalOption("--baz", "Baz");
program.command("foo [bar]", "Foo").action(({ bar }: any) => {
if(program.baz){
console.log(program.baz);
}
console.log(bar);
});
|
Great, thanks! I assume the second bug was fixed when the first one was solved 👍 |
Btw, any chance we can get a patch update with this fix? 🙏 |
Just updated it. v0.6.2 |
Thanks! |
@siokas This might be a followup, let me know if you want me to open a new issue. When using |
I tried like test("command_argument_parse_number_0", function () {
const program = new Denomander();
const args = ["foo", "0"];
let result = 1;
program.command("foo [bar]", "Foo")
.action(({ bar }: any) => {
result = bar;
});
program.parse(args);
assertEquals(result, 0);
}); and I am sure that it parses it as number because I also tried with |
Hi! I found a bug which happens when passing a number to a command.
How to reproduce:
deno run mod.ts foo 1
The error:
Also, when passing an option e.g.
deno run mod.ts foo bar --baz buz
, both bar and baz will have the valuebuz
instead offoo=bar
andbaz=buz
The text was updated successfully, but these errors were encountered: