CommandLineParserGetUsage Method

Gets a string containing command line usage help.

Definition

Namespace: Ookii.CommandLine
Assembly: Ookii.CommandLine (in Ookii.CommandLine.dll) Version: 4.2.0+a4d3631e4dcc0970081ed435288efdebc1325f83
C#
public string GetUsage(
	UsageWriter? usageWriter = null,
	int maximumLineLength = 0
)

Parameters

usageWriter  UsageWriter  (Optional)
The UsageWriter to use to create the usage. If , the value from the ParseOptionsUsageWriter property in the Options property is used.
maximumLineLength  Int32  (Optional)
The maximum line length of lines in the usage text. A value less than 1 or larger than 65536 is interpreted as infinite line length.

Return Value

String
A string containing usage help for the command line options defined by the type specified by ArgumentsType.

Remarks

The usage help consists of first the Description, followed by the usage syntax, followed by a description of all the arguments.

You can add descriptions to the usage text by applying the DescriptionAttribute attribute to your command line arguments type, and the properties and methods defining command line arguments.

Color is applied to the output only if the UsageWriter instance has enabled it.

See Also