5 #include "multiValue.h"
8 using namespace command;
10 #define VALUE "0,1,2,3,4,5,6,7,8,9"
12 typedef int ArgumentType;
14 std::vector<ArgumentType> input;
16 void _function(ArgumentType value) {
17 input.push_back(value);
18 cout << "Catched value: " << value << "\n";
22 Parameter * argument = new MultiValue(",", new Argument<ArgumentType>("Argument as multiValue int", _function));
25 if (argument->understand(VALUE)) {
29 cout << argument->describe() << " should understand multiple int values\n";
35 cout << argument->describe() << " thrown unknown exception\n";
40 for (int i = 0; i < 10; i++) {
41 test &= (input[i] == i);
42 cout << i << ") input: " << input[i] << "\n";
46 cout << argument->describe() << " handles boolean (TRUE) values\n";
51 cout << argument->describe() << " do not handle multiple int values\n";