Skip to content

Latest commit

 

History

History
34 lines (23 loc) · 1.91 KB

File metadata and controls

34 lines (23 loc) · 1.91 KB

MGR.CommandLineParser documentation

MGR.CommandLineParser is a multi-command line parser library. It provides an extensible mechanism to provide define commands (with multiple out-of-the-box providers) and is able to automatically generate help/usage output for all commands. Built-in providers lets you define command by:

  • creating classes that implements MGR.CommandLineParser.Command.ICommandHandler for the logic of your command and MGR.CommandLineParser.Command.CommandData for the data associated to the command, or inherits MGR.CommandLineParser.Command.CommandBase (provides some basic behavior for commands like support of --help option)
  • dynamically defining a command that uses a lambda as execution (via the package `MGR.CommandLineParser.Command.Lambda)

The general syntax on the command line is: <commandName> <options> <arguments>

Options can be specified by their normal/long form (--full-option) or with its short form (-fo). The value of the option can be separated of the name of the option by a space ( ) or a colon (:).

Arguments is a list of non-option string that is passed to the command.

There is also some ways to customize others parts of the parser:

This library use dependency injection to retrieve the implementation of all this service, so you just have to register your own implementation to override/augment the default behavior.