diff -r eebc16b7c3e4 -r d2ad84dcf249 src/CLIParser.h --- a/src/CLIParser.h Wed Oct 07 01:46:03 2020 +0200 +++ b/src/CLIParser.h Wed Oct 07 22:30:09 2020 +0200 @@ -48,9 +48,10 @@ public: - static const relpipe::common::type::StringX OPTION_JACK_CLIENT_NAME; - static const relpipe::common::type::StringX OPTION_JACK_CONNECT_TO_PORT; - static const relpipe::common::type::StringX OPTION_REQUIRED_JACK_CONNECTIONS; + static const relpipe::common::type::StringX OPTION_CLIENT; + static const relpipe::common::type::StringX OPTION_PORT; + static const relpipe::common::type::StringX OPTION_CONNECT_TO; + static const relpipe::common::type::StringX OPTION_REQUIRED_CONNECTIONS; Configuration parse(const std::vector& arguments) { Configuration c; @@ -58,12 +59,14 @@ for (int i = 0; i < arguments.size();) { relpipe::common::type::StringX option = readNext(arguments, i); - if (option == OPTION_JACK_CLIENT_NAME) { - c.jackClientName = readNext(arguments, i); - } else if (option == OPTION_JACK_CONNECT_TO_PORT) { - c.portsToConnect.push_back(readNext(arguments, i)); - } else if (option == OPTION_REQUIRED_JACK_CONNECTIONS) { - c.requiredJackConnections = std::stoi(readNext(arguments, i)); + if (option == OPTION_CLIENT) { + c.client = readNext(arguments, i); + } else if (option == OPTION_PORT) { + c.port = readNext(arguments, i); + } else if (option == OPTION_CONNECT_TO) { + c.connectTo.push_back(readNext(arguments, i)); + } else if (option == OPTION_REQUIRED_CONNECTIONS) { + c.requiredConnections = std::stoi(readNext(arguments, i)); } else throw relpipe::cli::RelpipeCLIException(L"Unsupported CLI option: " + option, relpipe::cli::CLI::EXIT_CODE_BAD_CLI_ARGUMENTS); } @@ -74,9 +77,10 @@ } }; -const relpipe::common::type::StringX CLIParser::OPTION_JACK_CLIENT_NAME = L"--jack-client-name"; -const relpipe::common::type::StringX CLIParser::OPTION_JACK_CONNECT_TO_PORT = L"--jack-connect-to-port"; -const relpipe::common::type::StringX CLIParser::OPTION_REQUIRED_JACK_CONNECTIONS = L"--required-jack-connections"; +const relpipe::common::type::StringX CLIParser::OPTION_CLIENT = L"--client"; +const relpipe::common::type::StringX CLIParser::OPTION_PORT = L"--port"; +const relpipe::common::type::StringX CLIParser::OPTION_CONNECT_TO = L"--connect-to"; +const relpipe::common::type::StringX CLIParser::OPTION_REQUIRED_CONNECTIONS = L"--required-connections"; } }