CommandManager(IEnumerableAssembly, CommandOptions) Constructor
Initializes a new instance of the
CommandManager class using the specified
assemblies.
Namespace: Ookii.CommandLine.CommandsAssembly: Ookii.CommandLine (in Ookii.CommandLine.dll) Version: 4.2.0+a4d3631e4dcc0970081ed435288efdebc1325f83
public CommandManager(
IEnumerable<Assembly> assemblies,
CommandOptions? options = null
)
Public Sub New (
assemblies As IEnumerable(Of Assembly),
Optional options As CommandOptions = Nothing
)
Dim assemblies As IEnumerable(Of Assembly)
Dim options As CommandOptions
Dim instance As New CommandManager(assemblies,
options)
public:
CommandManager(
IEnumerable<Assembly^>^ assemblies,
CommandOptions^ options = nullptr
)
Parameters
- assemblies IEnumerableAssembly
- The assemblies 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 assemblies for any
public classes that implement the ICommand interface, have the
CommandAttribute attribute, and are not .
If an assembly in assemblies is the assembly that called this
constructor, both public and internal command classes will be used. For other assemblies,
only public 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.