CommandManager(CommandOptions) Constructor
Initializes a new instance of the
CommandManager class for the assembly that
is calling the constructor.
Namespace: Ookii.CommandLine.CommandsAssembly: Ookii.CommandLine (in Ookii.CommandLine.dll) Version: 4.1.0+9df03b6173b5fc9d44dc39638758964dd7a0f4c7
public CommandManager(
CommandOptions? options = null
)
Public Sub New (
Optional options As CommandOptions = Nothing
)
Dim options As CommandOptions
Dim instance As New CommandManager(options)
public:
CommandManager(
CommandOptions^ options = nullptr
)
Parameters
- 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 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.
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.