Customize your class-based option
Implement ICommand
You can add options to your command by simply adding properties to your class. The properties can have any type, you just have to be sure there is a converter for this type (see the list of built-in converters).
You can customize the behavior of the options with some annotations (the parser supports the annotations from System.ComponentModel.DataAnnotations):
- Use
System.ComponentModel.DataAnnotations.DisplayAttribute
and some of its properties:Name
andShortName
to respectively change the long and short form of the optionDescription
to define a description in the auto-generated help for the option,
- Use any of the
System.ComponentModel.DataAnnotations.ValidationAttribute
derived class to validate the value provided for the option.