CommandLineArgumentValue Property

Gets the value that the argument was set to in the last call to CommandLineParserParse(String).

Definition

Namespace: Ookii.CommandLine
Assembly: Ookii.CommandLine (in Ookii.CommandLine.dll) Version: 4.0.0+bb7ed9a8fdfd1cb21824750a8cf508863ad15086
C#
public Object? Value { get; }

Property Value

Object
The value of the argument that was obtained when the command line arguments were parsed.

Remarks

The Value property provides an alternative method for accessing supplied argument values, in addition to using the object returned by CommandLineParserParse(String).

If an argument was supplied on the command line, the Value property will equal the supplied value after conversion to the type specified by the ArgumentType property, and the HasValue property will be .

If an optional argument was not supplied, the Value property will equal the DefaultValue property, and HasValue will be .

If the Kind property is ArgumentKindMultiValue, the Value property will return an array with all the values, even if the argument type is a collection type rather than an array.

If the Kind property is ArgumentKindDictionary, the Value property will return a DictionaryTKey, TValue with all the values, even if the argument type is a different type.

See Also