[Question] how do I make an option mandatory?
mattfrear opened this issue · comments
The documentation says that options can be made mandatory, but I can't see an example of how to do that.
I thought that maybe [Option(CommandOptionType.SingleValue)]
would do this, but it doesn't.
Here is a sample. This should probably be explicitly called out in the docs, too.
CommandLineUtils/docs/samples/validation/attributes/Program.cs
Lines 14 to 16 in 7281ee9
Oh, that's easy! Thanks.
I even went searching in here for Required and couldn't see it, cos that's the wrong place.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please comment if you believe this should remain open, otherwise it will be closed in 14 days. Thank you for your contributions to this project.
This issue has been automatically marked as stale because it has no recent activity. It will be closed if no further activity occurs. Please comment if you believe this should remain open, otherwise it will be closed in 14 days. Thank you for your contributions to this project.
Closing due to inactivity.
If you are looking at this issue in the future and think it should be reopened, please make a commented here and mention natemcmaster so he sees the notification.