1 #ifndef __COMMAND_ARGUMENT_H
2 #define __COMMAND_ARGUMENT_H
6 #include <command/descriptive.h>
10 * Class responsible for handling commandline arguments.
11 * Arguments are required non-named parameters for program.
16 template<typename ArgumentType>
17 class Argument : public Descriptive {
19 typedef void (*)(ArgumentType) FunctionType;
23 * Function handling user Arguments
25 FunctionType function;
29 * Default constructor.
31 * @param description Description of current Argument
32 * @param function Function used to handle current Argument.
34 Argument(std::string description, FunctionType function)
35 : Descriptive(description), function(function) {
39 * Executes command binded with argument
41 * @param value Value passed to program argument
43 void run(ArgumentType value) {
44 this->function(value);
49 #endif /* __COMMAND_ARGUMENT_H */