src/CLIParser.h
branchv_0
changeset 2 1a0fbd17db13
parent 0 7ef5ce9477c8
child 3 62ced7c41c67
--- a/src/CLIParser.h	Fri May 06 23:06:44 2022 +0200
+++ b/src/CLIParser.h	Sun May 08 21:42:25 2022 +0200
@@ -37,20 +37,10 @@
 		else throw relpipe::cli::RelpipeCLIException(L"Missing CLI argument" + (i > 0 ? (L" after " + arguments[i - 1]) : L""), relpipe::cli::CLI::EXIT_CODE_BAD_CLI_ARGUMENTS);
 	}
 
-	/**
-	 * TODO: use a common method
-	 */
-	bool parseBoolean(const relpipe::common::type::StringX& value) {
-		if (value == L"true") return true;
-		else if (value == L"false") return false;
-		else throw relpipe::cli::RelpipeCLIException(L"Unable to parse boolean value: " + value + L" (expecting true or false)", relpipe::cli::CLI::EXIT_CODE_BAD_CLI_ARGUMENTS);
-	}
-
 public:
 
 	static const relpipe::common::type::StringX OPTION_RELATION;
-	static const relpipe::common::type::StringX OPTION_UNLINK_ON_CLOSE;
-	static const relpipe::common::type::StringX OPTION_QUEUE;
+	static const relpipe::common::type::StringX OPTION_STREAM;
 
 	Configuration parse(const std::vector<relpipe::common::type::StringX>& arguments) {
 		Configuration c;
@@ -60,10 +50,8 @@
 
 			if (option == OPTION_RELATION) {
 				c.relation = readNext(arguments, i);
-			} else if (option == OPTION_UNLINK_ON_CLOSE) {
-				c.unlinkOnClose = parseBoolean(readNext(arguments, i));
-			} else if (option == OPTION_QUEUE) {
-				c.queue = readNext(arguments, i);
+			} else if (option == OPTION_STREAM) {
+				c.stream = readNext(arguments, i);
 			} else throw relpipe::cli::RelpipeCLIException(L"Unsupported CLI option: " + option, relpipe::cli::CLI::EXIT_CODE_BAD_CLI_ARGUMENTS);
 		}
 
@@ -75,8 +63,7 @@
 };
 
 const relpipe::common::type::StringX CLIParser::OPTION_RELATION = L"--relation";
-const relpipe::common::type::StringX CLIParser::OPTION_UNLINK_ON_CLOSE = L"--unlink-on-close";
-const relpipe::common::type::StringX CLIParser::OPTION_QUEUE = L"--queue";
+const relpipe::common::type::StringX CLIParser::OPTION_STREAM = L"--stream";
 
 }
 }