CommandLineArgumentAttributeDefaultValue Property

Gets or sets the default value to be assigned to the property if the argument is not supplied on the command line.

Definition

Namespace: Ookii.CommandLine
Assembly: Ookii.CommandLine (in Ookii.CommandLine.dll) Version: 3.0.0
C#
public Object? DefaultValue { get; set; }

Property Value

Object
The default value for the argument, or to not set the property if the argument is not supplied. The default value is .

Remarks

The DefaultValue property will not be used if the IsRequired property is , or if the argument is a multi-value or dictionary argument, or if the CommandLineArgumentAttribute attribute was applied to a method.

By default, the command line usage help generated by WriteUsage(UsageWriter) does not include the default value. Either manually add it to the description, or set the IncludeDefaultValueInDescription property to .

See Also