Click or drag to resize

CommandLineArgumentHasValue Property

Gets a value indicating whether the value of this argument was supplied on the command line in the last call to Parse(String, Int32).

Namespace:  Ookii.CommandLine
Assembly:  Ookii.CommandLine (in Ookii.CommandLine.dll) Version: 2.3.0
Syntax
public bool HasValue { get; }

Property Value

Type: Boolean
if this argument's value was supplied on the command line when the arguments were parsed; otherwise, .
Remarks

Use this property to determine whether or not an argument was supplied on the command line, or was assigned its default value.

When an optional argument is not supplied on the command line, the Value property will be equal to the DefaultValue property, and HasValue will be .

It is however possible for the user to supply a value on the command line that matches the default value. In that case, although the Value property will still be equal to the DefaultValue property, the HasValue property will be . This allows you to distinguish between an argument that was supplied or omitted even if the supplied value matches the default.

See Also