CommandManager(Assembly, CommandOptions) Constructor
Initializes a new instance of the
CommandManager class using the specified
assembly.
Namespace: Ookii.CommandLine.CommandsAssembly: Ookii.CommandLine (in Ookii.CommandLine.dll) Version: 4.0.0+bb7ed9a8fdfd1cb21824750a8cf508863ad15086
public CommandManager(
Assembly assembly,
CommandOptions? options = null
)
Public Sub New (
assembly As Assembly,
Optional options As CommandOptions = Nothing
)
Dim assembly As [Assembly]
Dim options As CommandOptions
Dim instance As New CommandManager(assembly,
options)
public:
CommandManager(
Assembly^ assembly,
CommandOptions^ options = nullptr
)
Parameters
- assembly Assembly
- The assembly containing the commands.
- options CommandOptions (Optional)
-
The options to use for parsing and usage help, or to use
the default options.
The CommandManager class will look in the specified assembly for any public
classes that implement the ICommand interface, have the
CommandAttribute attribute, and are not .
If assembly is the assembly that called this constructor, both public
and internal command classes will be used. Otherwise, only public command classes are
used.
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.
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.