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

How to define my commands ?

By default, MGR.CommandLineParser will look in every assembly in its own folder for every type that inherits ICommand by using MEF.

The name of your command is the name of the command's type. MGR.CommandLineParser will remove "Command" if the type of your command ends with it.

ICommand is defined as follow :

public interface ICommand
    void Execute();
    IList<string> Arguments { get; }

MGR.CommandLineParser offers you a base implementation with the abstract class CommandBase. This class implements the Arguments property, add an Help option (to show the help for the requested command), and the core logic to display this help.
By overriding CommandBase, you simply define your options (as property), and override the abstract ExecuteCommand method.

Last edited Mar 30, 2012 at 6:23 PM by mgrosperrin, version 4