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.DisplayAttributeand some of its properties:NameandShortNameto respectively change the long and short form of the optionDescriptionto define a description in the auto-generated help for the option,
- Use any of the
System.ComponentModel.DataAnnotations.ValidationAttributederived class to validate the value provided for the option.