You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Patrik edited this page Nov 14, 2017
·
6 revisions
The process to execute the command looks something like this:
Configure model -> Build reflection model -> Parse arguments -> Binding -> Invocation
1. Configure model
In the configuration step, we let the consumer of the API specify
the overall command structure.
2. Build reflection model
We then build a model that represents the commands and their options,
argument and other settings such as description.
3. Parse arguments
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).
4. Binding
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.
5. Invocation
Now we can instantiate the command itself and execute it by passing
the bound settings to it.