--- a/src/CLIParser.h Wed Oct 07 01:45:30 2020 +0200
+++ b/src/CLIParser.h Wed Oct 07 22:29:38 2020 +0200
@@ -48,10 +48,11 @@
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_LIST_JACK_PORTS;
+ 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;
+ static const relpipe::common::type::StringX OPTION_LIST_PORTS;
static const relpipe::common::type::StringX OPTION_LIST_MIDI_MESSAGES;
Configuration parse(const std::vector<relpipe::common::type::StringX>& arguments) {
@@ -60,14 +61,16 @@
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));
- } else if (option == OPTION_LIST_JACK_PORTS) {
- c.listJackPorts = parseBoolean(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 if (option == OPTION_LIST_PORTS) {
+ c.listPorts = parseBoolean(readNext(arguments, i));
} else if (option == OPTION_LIST_MIDI_MESSAGES) {
c.listMidiMessages = parseBoolean(readNext(arguments, i));
} else throw relpipe::cli::RelpipeCLIException(L"Unsupported CLI option: " + option, relpipe::cli::CLI::EXIT_CODE_BAD_CLI_ARGUMENTS);
@@ -80,10 +83,11 @@
}
};
-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_LIST_JACK_PORTS = L"--list-jack-ports";
+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";
+const relpipe::common::type::StringX CLIParser::OPTION_LIST_PORTS = L"--list-ports";
const relpipe::common::type::StringX CLIParser::OPTION_LIST_MIDI_MESSAGES = L"--list-midi-messages";
}