5 #include "multiValue.h"
8 using namespace command;
11 #define VALUE "0,1,2,3,4,5,6,7,8,9"
13 #define OPTION NAME "=" VALUE
15 typedef int OptionType;
17 std::vector<OptionType> input;
19 void _function(OptionType value) {
20 input.push_back(value);
21 cout << "Catched value: " << value << "\n";
25 Parameter * option = new MultiValue(",", new Option<OptionType>(NAME, "Option as multiValue int", _function));
28 if (option->understand(OPTION)) {
32 cout << option->describe() << " should understand multiple int values\n";
38 cout << option->describe() << " thrown unknown exception\n";
43 for (int i = 0; i < 10; i++) {
44 test &= (input[i] == i);
45 cout << i << ") input: " << input[i] << "\n";
49 cout << option->describe() << " handles boolean (TRUE) values\n";
54 cout << option->describe() << " do not handle multiple int values\n";