-
Notifications
You must be signed in to change notification settings - Fork 6
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
Optional values #69
Comments
@AMythicDev You can accomplish this using the The limitation here is that the Values still need to be provided in order. So if you have two Values on a Command, like an integer and a string, you can do all of these: cmd cmd 10 cmd 10 "some string" But you can not do: cmd "some string" Let me know if that works for you or if you have any other questions. Thanks for trying Cova! |
Thanks, the We can enforce that all the required value fields to be the last in value order and will always be matched. If they don't match, we raise an error. For optional values, they must be present before all required values and they are matched after all required values are matched. Let me know if you are interested in it and feel free to hit me if you want any help. Thanks again for the speedy response. |
That's doable, but it'd be a somewhat heavy change to the Value parsing. If I do implement it, I'll likely go with Mandatory Values first. Let me think about it a bit. In the interim, you could try sequentially looking for your required Values immediately after calling |
Thanks for looking into it. Will be happy to see it getting implemented. |
Currently there's no way to mark a
ValueT
as optional and the only possible workaround to this is to use aOptionT
with aval
field which limits the ergonomics on the CLI side. Having optional values can allow certain values to be passed directly without any prefix option.The text was updated successfully, but these errors were encountered: