IParserTSelf Interface

Defines a mechanism to parse command line arguments into a type.

Definition

Namespace: Ookii.CommandLine
Assembly: Ookii.CommandLine (in Ookii.CommandLine.dll) Version: 4.2.0+a4d3631e4dcc0970081ed435288efdebc1325f83
C#
public interface IParser<TSelf> : IParserProvider<TSelf>
where TSelf : class, Object, IParser<TSelf>
Implements
IParserProviderTSelf

Type Parameters

TSelf
The type that implements this interface.

Remarks

  Note

This type is only available when using .Net 7 or later.

This interface is automatically implemented on a class when the GeneratedParserAttribute is used. Classes without that attribute must parse arguments using the ParseT(ParseOptions) method, or create the parser directly by using the CommandLineParserT(ParseOptions) constructor; these classes do not support this interface unless it is manually implemented.

When using a version of .Net where static interface methods are not supported (versions prior to .Net 7.0), the GeneratedParserAttribute will still generate the same methods as defined by this interface, just without having them implement the interface.

Methods

CreateParser Creates a CommandLineParserT instance using the specified options.
(Inherited from IParserProviderTSelf)
Parse(ParseOptions) Parses the arguments returned by the EnvironmentGetCommandLineArgs method using the type TSelf, handling errors and showing usage help as required.
Parse(ReadOnlyMemoryString, ParseOptions) Parses the specified command line arguments using the type TSelf, handling errors and showing usage help as required.
Parse(String, ParseOptions) Parses the specified command line arguments using the type TSelf, handling errors and showing usage help as required.

See Also