IParserTSelfParse(ParseOptions) Method

Parses the arguments returned by the EnvironmentGetCommandLineArgs method using the type TSelf, handling errors and showing usage help as required.

Definition

Namespace: Ookii.CommandLine
Assembly: Ookii.CommandLine (in Ookii.CommandLine.dll) Version: 4.2.0+a4d3631e4dcc0970081ed435288efdebc1325f83
C#
TSelf Parse(
	ParseOptions? options = null
)

Parameters

options  ParseOptions  (Optional)
The options that control parsing behavior and usage help formatting. If , the default options are used.

Return Value

TSelf
An instance of the type TSelf, or if an error occurred or argument parsing was canceled.

Remarks

This method is typically generated for a class that defines command line arguments by the GeneratedParserAttribute attribute.

Exceptions

NotSupportedException The CommandLineParserT cannot use type TSelf as the command line arguments type, because it violates one of the rules concerning argument names or positions. Even when the parser was generated using the GeneratedParserAttribute class, not all those rules can be checked at compile time.

See Also