-
Notifications
You must be signed in to change notification settings - Fork 325
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
Enhancement: Improve message of invalid option in a Zod schema #6478
Comments
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
|
Yes, it does. By default, schema allows unknown options. You can restrict by including cli-microsoft365/src/m365/commands/login.ts Lines 13 to 31 in 10765f6
|
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
The text was updated successfully, but these errors were encountered: