This project has moved and is read-only. For the latest updates, please go here.

MGR.CommandLineParser.Extensibility.ICommandProvider Reference

This interface defines the methods and property used by the parser to retrieve the commands.
It defines a method to (re)build the commands, a method to retrieve a ICommand by its name, a method to retrieve the IHelpCommand, and a property that lists all available commands.


  • void BuildCommands() : (Re)Build the commands. This method retrieves and re-instantiates all commands. No new instance of ICommand should be created outside of this method.
  • ICommand GetCommand(string commandName) : Gets a ICommand by its name. Returns null if no command is found.
  • IHelpCommand GetHelpCommand() : Gets the IHelpCommand.

In the last two methods, no new instance should be created as the BuildCommands have not been called.


  • IEnumerable<ICommand> AllCommands {get; } : Returns the collection of commands retrieve by the last call to the method BuildCommands

Default implementation

The default implementation of ICommandProvider used MEF to retrieve the commands in all the assembly located in the same folder as MGR.CommandLineParser.dll

Last edited Apr 20, 2012 at 12:19 PM by mgrosperrin, version 3