-
Notifications
You must be signed in to change notification settings - Fork 15
Process
The process to execute the command looks something like this:
Configure model
-> Build reflection model
-> Parse arguments
-> Binding
-> Invocation
In the configuration step, we let the consumer of the API specify the overall command structure.
We then build a model that represents the commands and their options, argument and other settings such as description.
The next step is to parse the arguments into a command tree while also verifying it to the model we built in the previous step.
Here we also create string mappings for options and arguments to the different commands but we don't bind anything to the settings object (which do not exist yet).
Now we can take the parsed command tree and it's assigned options and arguments and bind the values to an instance of the leaf settings class. If you've specified a specific type converter for a value, here is where it will be used.
Now we can instantiate the command itself and execute it by passing the bound settings to it.