IParserProviderTSelf Interface

Defines a mechanism to create a CommandLineParserT for a type.

Definition

Namespace: Ookii.CommandLine
Assembly: Ookii.CommandLine (in Ookii.CommandLine.dll) Version: 4.0.0+bb7ed9a8fdfd1cb21824750a8cf508863ad15086
C#
public interface IParserProvider<TSelf>
where TSelf : class, Object, IParserProvider<TSelf>

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 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 method as defined by this interface, just without having it implement the interface.

Methods

CreateParser Creates a CommandLineParserT instance using the specified options.

See Also