You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 22, 2023. It is now read-only.
In my project I have a simple command to delete an element by its index, but when the argument is "0" and is parsed to a number through a custom parser the validator fails due to a missing argument exception.
Example:
import{Command}from"@oclif/command";exportdefaultclassTestCommandextendsCommand{staticdescription="Throws a missing argument exception when the argument is 0";staticargs=[{name: "value",required: true,description: "A number",parse: (value: string): number=>parseInt(value,10)}];publicasyncrun(): Promise<void>{const{ args }=this.parse(TestCommand);this.log(`Received: ${args.value}`);}}
Running the command with the argument "0" it will throw an exception with saying it has a missing value even though it was provided while running it with the argument "1" will run the command successfuly.
In my project I have a simple command to delete an element by its index, but when the argument is "0" and is parsed to a number through a custom parser the validator fails due to a missing argument exception.
Example:
Running the command with the argument "0" it will throw an exception with saying it has a missing value even though it was provided while running it with the argument "1" will run the command successfuly.
It seems to be caused by this comparison:
parser/src/validate.ts
Line 37 in ac66076
The text was updated successfully, but these errors were encountered: