-
Notifications
You must be signed in to change notification settings - Fork 5
How to customize the parser
Matthias GROSPERRIN edited this page Oct 24, 2015
·
1 revision
MGR.CommandLineParser offers four main extensibility points:
-
MGR.CommandLineParser.IConsole
: change the way the parser logs information to the user (by default, useSystem.Console
). Learn more -
MGR.CommandLineParser.Converters.IConverter
: used by the parser to convert the argument from the command line (asstring
) to the type of the option. Some converters are built-in (and known by the parser) but you can build your own to remplace existing one or convert unsupported types. Learn more -
MGR.CommandLineParser.ICommandTypeProvider
: used by the parser to retrieve all types of command. By default, the commands are retrieved by filtering all types implementingMGR.CommandLineParser.Command.ICommand
in all assemblies located in the current directory and the ones already loaded in the current AppDomain. Learn more -
MGR.CommandLineParser.ICommandActivator
: used by the parser to create a instance of a command. By default, the default constructor are called (usingActivator.CreateInstance
). Learn more
To change the implementation of these interfaces, use the dependency resolver.