public bool CancelParsing { get; set; }
Public Property CancelParsing As Boolean
Get
Set
Dim instance As CommandLineArgumentAttribute
Dim value As Boolean
value = instance.CancelParsing
instance.CancelParsing = value
public:
property bool CancelParsing {
bool get ();
void set (bool value);
}
If this property is , the CommandLineParser will stop parsing the command line arguments after seeing this argument, and return from the Parse(String, Int32) method or one of its overloads. Since no instance of the arguments type is returned, it's not possible to determine argument values, or which argument caused the cancellation, except by inspecting the Arguments property.
This property is most commonly useful to implement a "-Help" or "-?" style switch argument, where the presence of that argument causes usage help to be printed and the program to exit, regardless of whether the rest of the command line is valid or not.
The ParseT(String, ParseOptions) static helper method will print usage information if parsing was canceled through this method.
Canceling parsing in this way is identical to handling the ArgumentParsed event and setting Cancel to .
It's possible to prevent cancellation when an argument has this property set by handling the ArgumentParsed event and setting the OverrideCancelParsing property to .