Open MartinM85 opened 2 weeks ago
Thanks for bringing this up, @MartinM85. I wouldn't say it's a bug, because it's the default zod's behavior. That said, I agree that it could be clearer. Let's look for ways to improve it.
@waldekmastykarz Yes, enhancement makes more sense.
Maybe off topic, but does zod support unknown option?
Alternative to
public allowUnknownOptions(): boolean | undefined {
return true;
}
Yes, it does. By default, schema allows unknown options. You can restrict by including .strict()
in the schema definition:
Priority
(Low) Something is a little off
Description
When the command defines options in a Zod schema and the user type specify wrong option the output is
I would expect the message
Steps to reproduce
Run the command
Expected results
Actual results
Diagnostics
No response
CLI for Microsoft 365 version
v10.1.0
nodejs version
v20.8.1
Operating system (environment)
Windows
Shell
PowerShell
cli doctor
No response
Additional Info
No response