ndesk.options

How to enforce required command-line options with NDesk.Options?

£可爱£侵袭症+ 提交于 2019-12-17 18:25:40
问题 I was just writing a console utility and decided to use NDesk.Options for command-line parsing. My question is, How do I enforce required command-line options? I see in the docs that: options with a required value (append '=' to the option name) or an optional value (append ':' to the option name). However, when I put a = at the end of the option name there is no difference in behavior. Ideally the Parse method would throw an exception. Is there something else I need to do? Here is my test