ParseOptionsDuplicateArguments Property

Gets or sets a value indicating whether duplicate arguments are allowed.

Definition

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

Property Value

NullableErrorMode
One of the values of the ErrorMode enumeration, or to use the value from the ParseOptionsAttribute attribute, or if that attribute is not present, ErrorModeError. The default value is .

Remarks

If set to ErrorModeError, supplying a non-multi-value argument more than once will cause an exception. If set to ErrorModeAllow, the last value supplied will be used.

If set to ErrorModeWarning, the CommandLineParserTParseWithErrorHandling method, the static CommandLineParserParseT(ParseOptions) method, the generated IParserTSelfParse(ParseOptions) method and the CommandManager class will print a warning to the stream indicated by the Error property when a duplicate argument is found. If you are not using these methods, ErrorModeWarning is identical to ErrorModeAllow, and no warning is displayed.

If not , this property overrides the value of the ParseOptionsAttributeDuplicateArguments property.

See Also