src/CLIParser.h
branchv_0
changeset 15 463ce61415f1
parent 14 cde9bb07ea0a
equal deleted inserted replaced
14:cde9bb07ea0a 15:463ce61415f1
    54 	static const relpipe::common::type::StringX OPTION_CONNECT_PORTS;
    54 	static const relpipe::common::type::StringX OPTION_CONNECT_PORTS;
    55 	static const relpipe::common::type::StringX OPTION_DISCONNECT_PORTS;
    55 	static const relpipe::common::type::StringX OPTION_DISCONNECT_PORTS;
    56 	static const relpipe::common::type::StringX OPTION_REQUIRED_CONNECTIONS;
    56 	static const relpipe::common::type::StringX OPTION_REQUIRED_CONNECTIONS;
    57 	static const relpipe::common::type::StringX OPTION_LIST_PORTS;
    57 	static const relpipe::common::type::StringX OPTION_LIST_PORTS;
    58 	static const relpipe::common::type::StringX OPTION_LIST_CONNECTIONS;
    58 	static const relpipe::common::type::StringX OPTION_LIST_CONNECTIONS;
       
    59 	static const relpipe::common::type::StringX OPTION_LIST_PROPERTIES;
    59 	static const relpipe::common::type::StringX OPTION_LIST_MIDI_MESSAGES;
    60 	static const relpipe::common::type::StringX OPTION_LIST_MIDI_MESSAGES;
    60 
    61 
    61 	Configuration parse(const std::vector<relpipe::common::type::StringX>& arguments) {
    62 	Configuration parse(const std::vector<relpipe::common::type::StringX>& arguments) {
    62 		Configuration c;
    63 		Configuration c;
    63 
    64 
    76 				c.requiredConnections = std::stoi(readNext(arguments, i));
    77 				c.requiredConnections = std::stoi(readNext(arguments, i));
    77 			} else if (option == OPTION_LIST_PORTS) {
    78 			} else if (option == OPTION_LIST_PORTS) {
    78 				c.listPorts = parseBoolean(readNext(arguments, i));
    79 				c.listPorts = parseBoolean(readNext(arguments, i));
    79 			} else if (option == OPTION_LIST_CONNECTIONS) {
    80 			} else if (option == OPTION_LIST_CONNECTIONS) {
    80 				c.listConnections = parseBoolean(readNext(arguments, i));
    81 				c.listConnections = parseBoolean(readNext(arguments, i));
       
    82 			} else if (option == OPTION_LIST_PROPERTIES) {
       
    83 				c.listProperties = parseBoolean(readNext(arguments, i));
    81 			} else if (option == OPTION_LIST_MIDI_MESSAGES) {
    84 			} else if (option == OPTION_LIST_MIDI_MESSAGES) {
    82 				c.listMidiMessages = parseBoolean(readNext(arguments, i));
    85 				c.listMidiMessages = parseBoolean(readNext(arguments, i));
    83 			} else throw relpipe::cli::RelpipeCLIException(L"Unsupported CLI option: " + option, relpipe::cli::CLI::EXIT_CODE_BAD_CLI_ARGUMENTS);
    86 			} else throw relpipe::cli::RelpipeCLIException(L"Unsupported CLI option: " + option, relpipe::cli::CLI::EXIT_CODE_BAD_CLI_ARGUMENTS);
    84 		}
    87 		}
    85 
    88 
    96 const relpipe::common::type::StringX CLIParser::OPTION_CONNECT_PORTS = L"--connect-ports";
    99 const relpipe::common::type::StringX CLIParser::OPTION_CONNECT_PORTS = L"--connect-ports";
    97 const relpipe::common::type::StringX CLIParser::OPTION_DISCONNECT_PORTS = L"--disconnect-ports";
   100 const relpipe::common::type::StringX CLIParser::OPTION_DISCONNECT_PORTS = L"--disconnect-ports";
    98 const relpipe::common::type::StringX CLIParser::OPTION_REQUIRED_CONNECTIONS = L"--required-connections";
   101 const relpipe::common::type::StringX CLIParser::OPTION_REQUIRED_CONNECTIONS = L"--required-connections";
    99 const relpipe::common::type::StringX CLIParser::OPTION_LIST_PORTS = L"--list-ports";
   102 const relpipe::common::type::StringX CLIParser::OPTION_LIST_PORTS = L"--list-ports";
   100 const relpipe::common::type::StringX CLIParser::OPTION_LIST_CONNECTIONS = L"--list-connections";
   103 const relpipe::common::type::StringX CLIParser::OPTION_LIST_CONNECTIONS = L"--list-connections";
       
   104 const relpipe::common::type::StringX CLIParser::OPTION_LIST_PROPERTIES = L"--list-properties";
   101 const relpipe::common::type::StringX CLIParser::OPTION_LIST_MIDI_MESSAGES = L"--list-midi-messages";
   105 const relpipe::common::type::StringX CLIParser::OPTION_LIST_MIDI_MESSAGES = L"--list-midi-messages";
   102 
   106 
   103 }
   107 }
   104 }
   108 }
   105 }
   109 }