Replies: 2 comments
-
Give |
Beta Was this translation helpful? Give feedback.
-
Thank for the suggestion. I've used Frankly, I would be fine with my solution doing it in the command action, if there was a way to report an error like validators or custom parsers, but I don't think that's possible. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I know how to validate individual options, but I have a use case where I have 2 options that need to be validated together.
Take the following example where the command takes 2 dates. Each date option has a default value when omitted. The command needs to make sure that the dates are valid with each other.
How do I do that?
I have tried using a validator on the command, but it appears to be executed before the options are parsed, so I don't have access to the value created by
DefaultValueFactory
.The above code is the best approximation I have, but I don't see a way to generate a validation error that late in the execution flow when inside the action handler.
Beta Was this translation helpful? Give feedback.
All reactions