ParseOptionsAttributeDuplicateArguments 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

ErrorMode
One of the values of the ErrorMode enumeration. The default value is ErrorModeError.

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 Ookii.CommandLine.CommandsCommandManager class will print a warning to the ParseOptionsError stream when a duplicate argument is found. If you are not using these methods, ErrorModeWarning is identical to ErrorModeAllow and no warning is displayed. To manually display a warning, use the CommandLineParserDuplicateArgument event.

This value can be overridden by the ParseOptionsDuplicateArguments property.

See Also