Click or drag to resize

CommandLineParserWriteUsage Method (TextWriter, Int32, WriteUsageOptions)

Writes command line usage help to the specified TextWriter using the specified options.

Namespace:  Ookii.CommandLine
Assembly:  Ookii.CommandLine (in Ookii.CommandLine.dll) Version: 2.3.0
Syntax
public void WriteUsage(
	TextWriter writer,
	int maximumLineLength,
	WriteUsageOptions options
)

Parameters

writer
Type: System.IOTextWriter
The TextWriter to write the usage to.
maximumLineLength
Type: SystemInt32
The maximum line length of lines in the usage text; if writer is an instance of LineWrappingTextWriter, this parameter is ignored. 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.
Exceptions
ExceptionCondition
ArgumentNullExceptionwriter or options 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. If the specified writer is an instance of the LineWrappingTextWriter class, its MaximumLineLength property is used and the maximumLineLength parameter is ignored.

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

See Also