CommandLineParserUnknownArgument Event

Event raised when an unknown argument name or a positional value with no matching argument is used.

Definition

Namespace: Ookii.CommandLine
Assembly: Ookii.CommandLine (in Ookii.CommandLine.dll) Version: 4.2.0+a4d3631e4dcc0970081ed435288efdebc1325f83
C#
public event EventHandler<UnknownArgumentEventArgs> UnknownArgument

Value

EventHandlerUnknownArgumentEventArgs

Remarks

Specifying an argument with an unknown name, or too many positional arguments, is normally an error. By handling this event and setting the UnknownArgumentEventArgsIgnore property to , you can instead continue parsing the remainder of the command line, ignoring the unknown argument.

You can also cancel parsing instead using the UnknownArgumentEventArgsCancelParsing property.

If an unknown argument name is encountered and is followed by a value separated by whitespace, that value will be treated as the next positional argument value. It is not considered to be a value for the unknown argument.

See Also