rename --endpoint-url to --connection-string v_0 tip
authorFrantišek Kučera <franta-hg@frantovo.cz>
Sat, 23 Jul 2022 21:36:01 +0200
branchv_0
changeset 3 3891db9e45b7
parent 2 f724d805c34a
rename --endpoint-url to --connection-string
bash-completion.sh
src/CLIParser.h
src/Configuration.h
src/ZeroMQCommand.cpp
--- a/bash-completion.sh	Mon May 02 17:59:10 2022 +0200
+++ b/bash-completion.sh	Sat Jul 23 21:36:01 2022 +0200
@@ -23,12 +23,12 @@
 	w3=${COMP_WORDS[COMP_CWORD-3]}
 
 	if   [[ "$w1" == "--relation"                      && "x$w0" == "x" ]];    then COMPREPLY=("''")
-	elif [[ "$w1" == "--endpoint-url"                  && "x$w0" == "x" ]];    then COMPREPLY=("'tcp://*:1234'")
+	elif [[ "$w1" == "--connection-string"             && "x$w0" == "x" ]];    then COMPREPLY=("'tcp://*:1234'")
 	elif [[ "$w1" == "--message-count"                 && "x$w0" == "x" ]];    then COMPREPLY=("1")
 	else
 		OPTIONS=(
 			"--relation"
-			"--endpoint-url"
+			"--connection-string"
 			"--message-count"
 		)
 		COMPREPLY=($(compgen -W "${OPTIONS[*]}" -- "$w0"))
--- a/src/CLIParser.h	Mon May 02 17:59:10 2022 +0200
+++ b/src/CLIParser.h	Sat Jul 23 21:36:01 2022 +0200
@@ -40,7 +40,7 @@
 public:
 
 	static const relpipe::writer::string_t OPTION_RELATION;
-	static const relpipe::writer::string_t OPTION_ENDPOINT_URL;
+	static const relpipe::writer::string_t OPTION_CONNECTION_STRING;
 	static const relpipe::writer::string_t OPTION_MESSAGE_COUNT;
 
 	Configuration parse(const std::vector<relpipe::writer::string_t>& arguments) {
@@ -51,8 +51,8 @@
 			
 			if (option == OPTION_RELATION) {
 				c.relation = readNext(arguments, i);
-			} else if (option == OPTION_ENDPOINT_URL) {
-				c.endpointUrl = readNext(arguments, i);
+			} else if (option == OPTION_CONNECTION_STRING) {
+				c.connectionString = readNext(arguments, i);
 			} else if (option == OPTION_MESSAGE_COUNT) {
 				c.messageCount = std::stoull(readNext(arguments, i));
 			} else throw relpipe::cli::RelpipeCLIException(L"Unsupported CLI option: " + option, relpipe::cli::CLI::EXIT_CODE_BAD_CLI_ARGUMENTS);
@@ -66,7 +66,7 @@
 };
 
 const relpipe::writer::string_t CLIParser::OPTION_RELATION = L"--relation";
-const relpipe::writer::string_t CLIParser::OPTION_ENDPOINT_URL = L"--endpoint-url";
+const relpipe::writer::string_t CLIParser::OPTION_CONNECTION_STRING = L"--connection-string";
 const relpipe::writer::string_t CLIParser::OPTION_MESSAGE_COUNT = L"--message-count";
 
 }
--- a/src/Configuration.h	Mon May 02 17:59:10 2022 +0200
+++ b/src/Configuration.h	Sat Jul 23 21:36:01 2022 +0200
@@ -31,7 +31,7 @@
 
 	relpipe::common::type::StringX relation = L"message";
 	relpipe::common::type::Integer messageCount = 1;
-	relpipe::common::type::StringX endpointUrl = L"tcp://*:1234";
+	relpipe::common::type::StringX connectionString = L"tcp://*:1234";
 
 	virtual ~Configuration() {
 	}
--- a/src/ZeroMQCommand.cpp	Mon May 02 17:59:10 2022 +0200
+++ b/src/ZeroMQCommand.cpp	Sat Jul 23 21:36:01 2022 +0200
@@ -47,7 +47,7 @@
 void ZeroMQCommand::process(std::shared_ptr<writer::RelationalWriter> writer, Configuration& configuration) {
 	zmq::context_t zmqContext;
 	zmq::socket_t zmqSocket(zmqContext, zmq::socket_type::pull);
-	zmqSocket.bind(convertor.to_bytes(configuration.endpointUrl));
+	zmqSocket.bind(convertor.to_bytes(configuration.connectionString));
 
 
 	if (false) {