CommandLineUtils
CommandLineUtils copied to clipboard
[Question] how do I make an option mandatory?
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. https://github.com/natemcmaster/CommandLineUtils/blob/7281ee9fef08286a3a0a4f72d04b1d234747b316/docs/samples/validation/attributes/Program.cs#L14-L16
Oh, that's easy! Thanks. I even went searching in here for Required and couldn't see it, cos that's the wrong place.
https://natemcmaster.github.io/CommandLineUtils/v2.5/api/McMaster.Extensions.CommandLineUtils.OptionAttribute.html
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.