CommandManager(CommandOptions) Constructor

Initializes a new instance of the CommandManager class for the assembly that is calling the constructor.

Definition

Namespace: Ookii.CommandLine.Commands
Assembly: Ookii.CommandLine (in Ookii.CommandLine.dll) Version: 4.0.0+bb7ed9a8fdfd1cb21824750a8cf508863ad15086
C#
public CommandManager(
	CommandOptions? options = null
)

Parameters

options  CommandOptions  (Optional)
The options to use for parsing and usage help, or to use the default options.

Remarks

The CommandManager class will look in the calling assembly for any public or internal classes that implement the ICommand interface, have the CommandAttribute attribute, and are not .

This constructor uses reflection to determine which commands are available at runtime. To use source generation to locate commands at compile time, use the GeneratedCommandManagerAttribute attribute.

  Note

Once a command is created, the options instance may be modified with the options of the ParseOptionsAttribute attribute applied to the command class. Be aware of this if reusing the same CommandManager or CommandOptions instance to create multiple commands.

See Also