Click or drag to resize

CommandLineParserWriteUsageToConsole Method (WriteUsageOptions)

Writes command line usage help to the standard output stream using the specified options.

Namespace:  Ookii.CommandLine
Assembly:  Ookii.CommandLine (in Ookii.CommandLine.dll) Version: 2.3.0
Syntax
public void WriteUsageToConsole(
	WriteUsageOptions options
)

Parameters

options
Type: Ookii.CommandLineWriteUsageOptions
The options to use for formatting the usage.
Exceptions
ExceptionCondition
ArgumentNullExceptionoptions is .
ArgumentOutOfRangeExceptionIndent is less than zero or greater than or equal to WindowWidth - 1, or ArgumentDescriptionIndent is less than zero or greater than or equal to WindowWidth - 1.
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 console's window width. When the console output is redirected to a file, Microsoft .Net will still report the console's actual window width, but on Mono the value of the WindowWidth property will be 0. In that case, the usage information will not be wrapped.

This method indents additional lines for the usage syntax and argument descriptions, unless the WindowWidth property is less than 31.

See Also