src/CLIParser.h
branchv_0
changeset 8 b498160cc2ab
parent 7 039b3f8a3442
equal deleted inserted replaced
7:039b3f8a3442 8:b498160cc2ab
    49 public:
    49 public:
    50 
    50 
    51 	static const relpipe::common::type::StringX OPTION_LIST_INPUT_DEVICES;
    51 	static const relpipe::common::type::StringX OPTION_LIST_INPUT_DEVICES;
    52 	static const relpipe::common::type::StringX OPTION_LIST_INPUT_EVENTS;
    52 	static const relpipe::common::type::StringX OPTION_LIST_INPUT_EVENTS;
    53 	static const relpipe::common::type::StringX OPTION_LIST_WINDOWS;
    53 	static const relpipe::common::type::StringX OPTION_LIST_WINDOWS;
       
    54 	static const relpipe::common::type::StringX OPTION_LIST_SCREENS;
    54 
    55 
    55 	Configuration parse(const std::vector<relpipe::common::type::StringX>& arguments) {
    56 	Configuration parse(const std::vector<relpipe::common::type::StringX>& arguments) {
    56 		Configuration c;
    57 		Configuration c;
    57 
    58 
    58 		if (arguments.size() == 0) c.listInputDevices = true;
    59 		if (arguments.size() == 0) c.listInputDevices = true;
    64 				c.listInputDevices = parseBoolean(readNext(arguments, i));
    65 				c.listInputDevices = parseBoolean(readNext(arguments, i));
    65 			} else if (option == OPTION_LIST_INPUT_EVENTS) {
    66 			} else if (option == OPTION_LIST_INPUT_EVENTS) {
    66 				c.listInputEvents = parseBoolean(readNext(arguments, i));
    67 				c.listInputEvents = parseBoolean(readNext(arguments, i));
    67 			} else if (option == OPTION_LIST_WINDOWS) {
    68 			} else if (option == OPTION_LIST_WINDOWS) {
    68 				c.listWindows = parseBoolean(readNext(arguments, i));
    69 				c.listWindows = parseBoolean(readNext(arguments, i));
       
    70 			} else if (option == OPTION_LIST_SCREENS) {
       
    71 				c.listScreens = parseBoolean(readNext(arguments, i));
    69 			} else throw relpipe::cli::RelpipeCLIException(L"Unsupported CLI option: " + option, relpipe::cli::CLI::EXIT_CODE_BAD_CLI_ARGUMENTS);
    72 			} else throw relpipe::cli::RelpipeCLIException(L"Unsupported CLI option: " + option, relpipe::cli::CLI::EXIT_CODE_BAD_CLI_ARGUMENTS);
    70 		}
    73 		}
    71 
    74 
    72 		return c;
    75 		return c;
    73 	}
    76 	}
    77 };
    80 };
    78 
    81 
    79 const relpipe::common::type::StringX CLIParser::OPTION_LIST_INPUT_DEVICES = L"--list-input-devices";
    82 const relpipe::common::type::StringX CLIParser::OPTION_LIST_INPUT_DEVICES = L"--list-input-devices";
    80 const relpipe::common::type::StringX CLIParser::OPTION_LIST_INPUT_EVENTS = L"--list-input-events";
    83 const relpipe::common::type::StringX CLIParser::OPTION_LIST_INPUT_EVENTS = L"--list-input-events";
    81 const relpipe::common::type::StringX CLIParser::OPTION_LIST_WINDOWS = L"--list-windows";
    84 const relpipe::common::type::StringX CLIParser::OPTION_LIST_WINDOWS = L"--list-windows";
       
    85 const relpipe::common::type::StringX CLIParser::OPTION_LIST_SCREENS = L"--list-screens";
    82 
    86 
    83 }
    87 }
    84 }
    88 }
    85 }
    89 }