-
Notifications
You must be signed in to change notification settings - Fork 5
Change the way the command are retrived
MGR.CommandLineParser needs to know how to locate your commands. This is done via the MGR.CommandLineParser.ICommandTypeProvider interface. This interface provides three methods to retrieve one or more MGR.CommandLineParser.CommandType. This type is a wrapper around the command and its metadata (name, list of properties, etc.).
MGR.CommandLineParser provides a default implementation of this interface: MGR.CommandLineParser.AssemblyBrowsingCommandTypeProvider. This implementation take as parameter another interface (MGR.CommandLineParser.IAssemblyProvider) that provides a list of assemblies. The default implementation will browse the assemblies ot find all type that implements ICommand. For each of them, a new CommandType will be created and cached.
There is two built-in implementation of IAssemblyProvider:
-
MGR.CommandLineParser.CurrentDirectoryAssemblyProvider(the default): load all assemblies in the same directory as the parser, and returns all assemblies loaded in the current AppDomain. -
MGR.CommandLineParser.RecursiveAssemblyProvider: do the same things, but load all assemblies in the same directory of the parser AND of sub-directories.
You can change the implementation of these two interfaces through the dependency resolver.