ParseResultRemainingArguments Property

Gets any arguments that were not parsed by the CommandLineParser if parsing was canceled or an error occurred.

Definition

Namespace: Ookii.CommandLine
Assembly: Ookii.CommandLine (in Ookii.CommandLine.dll) Version: 4.2.0+a4d3631e4dcc0970081ed435288efdebc1325f83
C#
public ReadOnlyMemory<string> RemainingArguments { get; }

Property Value

ReadOnlyMemoryString
A ReadOnlyMemoryT instance with the remaining arguments, or an empty collection if there were no remaining arguments.

Remarks

If parsing succeeded without encountering an argument using CancelModeSuccess, this collection will always be empty.

If a CommandLineArgumentException exception was thrown, which arguments count as remaining depends on the type of error. For errors that occur during parsing, such as an unknown argument name, value conversion errors, validation errors, duplicate arguments, and others, the remaining arguments will be set to include the argument that threw the exception, and all arguments after it.

For errors that occur after parsing is finished, such as validation errors from a validator that uses AfterParsing, or an exception thrown by the target class, this collection will be empty.

See Also