UsageWriterGetUsage Method

Returns a string with usage help for the specified parser.

Definition

Namespace: Ookii.CommandLine
Assembly: Ookii.CommandLine (in Ookii.CommandLine.dll) Version: 4.2.0+a4d3631e4dcc0970081ed435288efdebc1325f83
C#
public string GetUsage(
	CommandLineParser parser,
	UsageHelpRequest request = UsageHelpRequest.Full,
	int maximumLineLength = 0
)

Parameters

parser  CommandLineParser
The CommandLineParser.
request  UsageHelpRequest  (Optional)
The parts of usage to write.
maximumLineLength  Int32  (Optional)
The length at which to white-space wrap lines in the output, or 0 to disable wrapping.

Return Value

String
A string containing the usage help.

Remarks

This method ignores the writer passed to the UsageWriter(LineWrappingTextWriter, NullableBoolean) constructor, and will use the LineWrappingTextWriterForStringWriter(Int32, IFormatProvider, Boolean) method instead, and returns the resulting string. If color support was not explicitly enabled, it will be disabled.

This method calls the WriteParserUsageCore(UsageHelpRequest) method to create the usage help text.

Exceptions

See Also