6 using namespace command;
12 #define OPTION1 NAME "=" FALSE
13 #define OPTION2 NAME "=" TRUE
15 typedef bool OptionType;
19 void _function(OptionType value) {
24 Option<OptionType> option(NAME, "Option with boolean value", _function);
26 if (option.understand(OPTION1)) {
30 cout << option.describe() << " do not understand " << FALSE << " values\n";
34 if (test == (bool)std::stoi(FALSE)) {
35 cout << option.describe() << " handles " << FALSE << " values\n";
38 Option<OptionType> option2(NAME, "Option with boolean value", _function);
40 if (option2.understand(OPTION2)) {
44 cout << option.describe() << " do not understand " << TRUE << " values\n";
48 if (test == (bool)std::stoi(TRUE)) {
49 cout << option.describe() << " handles " << TRUE << " values\n";
53 cout << "Option class do not handle boolean values\n" << test;