All of the examples so far have illustrated options with required arguments; that is, if the option is passed, it must be followed by an argument. It’s also possible to define an option that takes an optional argument:
The last example above illustrates the problem with options that take optional arguments: there isn’t an easy way to determine whether the option was passed without an argument or the option was not passed at all. In both of these cases, the property is left at the default value (null in this case).
The solution is to use the OptionPresent attribute, as such:
It is now possible to distinguish all possibilities. The OptionPresent example above uses the short option name, but this attribute also works with long names.