Click or drag to resize

CommandLineParserGetUsage Method (Int32, WriteUsageOptions)

Gets command line usage help.

Namespace:  Ookii.CommandLine
Assembly:  Ookii.CommandLine (in Ookii.CommandLine.dll) Version: 2.4.0
Syntax
public string GetUsage(
	int maximumLineLength,
	WriteUsageOptions options
)

Parameters

maximumLineLength
Type: SystemInt32
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.
options
Type: Ookii.CommandLineWriteUsageOptions
The options to use for formatting the usage.

Return Value

Type: String
A string containing usage help for the command line options defined by the type specified by ArgumentsType.
Exceptions
ExceptionCondition
ArgumentNullExceptionoptions is .
ArgumentOutOfRangeExceptionIndent is less than zero or greater than or equal to maximumLineLength, or ArgumentDescriptionIndent is less than zero or greater than or equal to maximumLineLength.
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 constructor parameters and properties defining command line arguments.

Line wrapping at word boundaries is applied to the output, wrapping at the specified line length.

This method indents additional lines for the usage syntax and argument descriptions, unless the maximum line length is less than 30.

See Also