*/
class Command {
protected:
- std::vector<Parameter *> args;
+ std::vector<Parameter *> parameters;
public:
/**
* Default constructor.
* responsible for correctly handle user data.
*/
Command(unsigned int argc, char *argv[], std::initializer_list<Parameter *> params)
- : args(params) {
+ : parameters(params) {
matchArguments(argc, argv);
invoke();
* Destructor. Releases allocated memory.
*/
~Command() {
- for (Parameter * parameter : args) {
+ for (Parameter * parameter : parameters) {
delete parameter;
}
}
* Invokes passed parameter handlers
*/
void invoke() {
- for(Parameter *param : params) {
+ for(Parameter *param : parameters) {
param->handle();
}
}