Click or drag to resize

ShellCommandWriteAssemblyCommandList Method (TextWriter, Assembly, String)

Writes a list of all the shell commands in the specified assembly to the specified TextWriter using the specified formatting options.

Namespace:  Ookii.CommandLine
Assembly:  Ookii.CommandLine (in Ookii.CommandLine.dll) Version: 2.3.0
Syntax
public static void WriteAssemblyCommandList(
	TextWriter writer,
	Assembly assembly,
	string commandFormat
)

Parameters

writer
Type: System.IOTextWriter
The TextWriter to write the commands to.
assembly
Type: System.ReflectionAssembly
The assembly that contains the shell commands.
commandFormat
Type: SystemString
The format string used to format a command's name and description, for example "{0,13} : {1}".
Exceptions
ExceptionCondition
ArgumentNullExceptionwriter, assembly or commandFormat is .
Remarks

The commandFormat should have two placeholders, which are used for the command name and description respectively.

This method writes a list of all shell command names and their descriptions to writer.

A command's name is retrieved from its ShellCommandAttribute attribute, and the description is retrieved from its DescriptionAttribute attribute.

If writer is a LineWrappingTextWriter, the writer's indent will be reset before every command. It is recommended to set the Indent property to a value appropriate for your commandFormat.

See Also