-
Notifications
You must be signed in to change notification settings - Fork 0
Calling the engine in your code
You can use the two classes in the root CommandLineEngine namespace to interact with your code once configured.
In order to execute a command, you need to call the engine from your code.
This class contains a single method, Execute(), whose main propose is to execute.
This method should be called from the
Mainmethod, by passing the recieved command line arguments.
Many overloads exists, but the full list of parameters is:
| Name | Use |
|---|---|
| string[] args | Required. Arguments recieved from command line. |
| Type[] types | Type in which to extract commands. Can be null to scan entire assembly, a single type, or a list of types. Can also be in external assembly. |
| IHelpFormatter helpFormatter | Formatter to use when displaying help. By default, to a console. |
| Action<Parser.Configuration> configurationBuilder | Action to configure the engine. |
If you pass
nullasargs, they will be gathered from theEnvironmentclass.
This class contains methods to Parse() the commands and parameters and PrintHelp().
This class should not be called directly, mostly used by
CommandExecutorand for debugging purposes.
Need more information or have an idea? Do not hesitate to reach out or submit a pull request.