-
Notifications
You must be signed in to change notification settings - Fork 0
Configuring parameters
A command is executed with parameters, which map to the parameters of the functions. Since code parameters can have default values, command parameters are printed in help as parameters when required and options when optional (or having default values).
All method parameters are automatically mapped to either parameters or options depending on if a default value is specified in the code and the method name is used.
However, it is possible to decorate a parameter the Parameter
attribute, located in the CommandLineEngine.Attributes
namespace to override values.
This attribute accepts the following values, all of which are optional:
Property | Use |
---|---|
Name | Allows you to override the name of the parameter, by default, uses the parameter name. Passed as --name value . |
ShortName | Allows you to specify a a short name for the parameter. Passed as -shortName value . |
Description | Allows you to specify a description for the parameter, will be shown in help. |
A command will be executable using
MyApp.exe commandName --name nameValue -shortName shortNameValue
Need more information or have an idea? Do not hesitate to reach out or submit a pull request.