Custom Conversion
How command-line values (always string) are converted into typed properties
The command-line is always text. Therefore an Option value is always of type string - the string as it was provided in the command-line.
A Command requires Parameters - a typed object - and in between type / value conversion takes place. CLarg
comes with out-of-the-box support for the following Parameter property types:
string
bool
int
DateTime
Enum
If you want to turn command-line arguments into other (user-defined) object types you have to provide your own converter. For example, the property type FileInfo
requires your custom converter.
Last updated