rename --endpoint-url to --connection-string v_0 tip
authorFrantišek Kučera <franta-hg@frantovo.cz>
Sat, 23 Jul 2022 21:35:51 +0200
branchv_0
changeset 2 e6294ba5017f
parent 1 ccaed729f8d3
rename --endpoint-url to --connection-string
bash-completion.sh
src/CLIParser.h
src/Configuration.h
src/ZeroMQHandler.h
--- a/bash-completion.sh	Sun May 01 22:27:42 2022 +0200
+++ b/bash-completion.sh	Sat Jul 23 21:35:51 2022 +0200
@@ -22,10 +22,10 @@
 	w2=${COMP_WORDS[COMP_CWORD-2]}
 	w3=${COMP_WORDS[COMP_CWORD-3]}
 
-	if   [[ "$w1" == "--endpoint-url"                  && "x$w0" == "x" ]];    then COMPREPLY=("'tcp://localhost:1234'")
+	if   [[ "$w1" == "--connection-string"             && "x$w0" == "x" ]];    then COMPREPLY=("'tcp://localhost:1234'")
 	else
 		OPTIONS=(
-			"--endpoint-url"
+			"--connection-string"
 		)
 		COMPREPLY=($(compgen -W "${OPTIONS[*]}" -- "$w0"))
 	fi
--- a/src/CLIParser.h	Sun May 01 22:27:42 2022 +0200
+++ b/src/CLIParser.h	Sat Jul 23 21:35:51 2022 +0200
@@ -39,7 +39,7 @@
 
 public:
 
-	static const relpipe::common::type::StringX OPTION_ENDPOINT_URL;
+	static const relpipe::common::type::StringX OPTION_CONNECTION_STRING;
 
 	Configuration parse(const std::vector<relpipe::common::type::StringX>& arguments) {
 		Configuration c;
@@ -47,8 +47,8 @@
 		for (int i = 0; i < arguments.size();) {
 			relpipe::common::type::StringX option = readNext(arguments, i);
 
-			if (option == OPTION_ENDPOINT_URL) {
-				c.endpointUrl = readNext(arguments, i);
+			if (option == OPTION_CONNECTION_STRING) {
+				c.connectionString = readNext(arguments, i);
 			} else throw relpipe::cli::RelpipeCLIException(L"Unsupported CLI option: " + option, relpipe::cli::CLI::EXIT_CODE_BAD_CLI_ARGUMENTS);
 		}
 
@@ -59,7 +59,7 @@
 	}
 };
 
-const relpipe::common::type::StringX CLIParser::OPTION_ENDPOINT_URL = L"--endpoint-url";
+const relpipe::common::type::StringX CLIParser::OPTION_CONNECTION_STRING = L"--connection-string";
 
 }
 }
--- a/src/Configuration.h	Sun May 01 22:27:42 2022 +0200
+++ b/src/Configuration.h	Sat Jul 23 21:35:51 2022 +0200
@@ -29,7 +29,7 @@
 class Configuration {
 public:
 
-	relpipe::common::type::StringX endpointUrl = L"tcp://localhost:1234";
+	relpipe::common::type::StringX connectionString = L"tcp://localhost:1234";
 
 	virtual ~Configuration() {
 	}
--- a/src/ZeroMQHandler.h	Sun May 01 22:27:42 2022 +0200
+++ b/src/ZeroMQHandler.h	Sat Jul 23 21:35:51 2022 +0200
@@ -55,7 +55,7 @@
 public:
 
 	ZeroMQHandler(Configuration configuration) : configuration(configuration), zmqSocket(zmqContext, zmq::socket_type::push) {
-		zmqSocket.connect(convertor.to_bytes(configuration.endpointUrl));
+		zmqSocket.connect(convertor.to_bytes(configuration.connectionString));
 	}
 
 	void startRelation(relpipe::common::type::StringX name, std::vector<relpipe::reader::handlers::AttributeMetadata> attributes) override {