GeneratedParserAttribute.GenerateParseMethods Property

Gets or sets a value that indicates whether to generate an implementation of the IParser<TSelf> interface for the arguments class.

Definition

Namespace: Ookii.CommandLine
Assembly: Ookii.CommandLine (in Ookii.CommandLine.dll) Version: 4.1.0+9df03b6173b5fc9d44dc39638758964dd7a0f4c7
C#
public bool GenerateParseMethods { get; set; }

Property Value

Boolean
true to generate an implementation of the IParser<TSelf> interface; otherwise, false. The default value is true, but see the remarks.

Remarks

When this property is true, the source generator will add static Parse methods to the arguments class which will create a parser and parse the command line arguments in one go. If using .Net 7.0 or later, this will implement the IParser<TSelf> interface on the class.

If this property is false, only the IParserProvider<TSelf> interface will be implemented.

The default behavior is to generate an implementation of the IParser<TSelf> interface methods unless this property is explicitly set to false. However, if the class is a subcommand (it implements the ICommand interface and has the CommandAttribute attribute), the default is to not implement the IParser<TSelf> interface unless this property is explicitly set to true.

See Also