src/CLIParser.h
branchv_0
changeset 5 cbc7817a3346
parent 2 362f2689cb87
child 10 7da7173d84b0
--- a/src/CLIParser.h	Tue Jul 30 15:51:35 2019 +0200
+++ b/src/CLIParser.h	Tue Jul 30 17:06:41 2019 +0200
@@ -50,6 +50,8 @@
 
 	static const string_t OPTION_RELATION;
 	static const string_t OPTION_PARAMETER;
+	static const string_t OPTION_FILE;
+	static const string_t OPTION_KEEP_FILE;
 
 	Configuration parse(const std::vector<string_t>& arguments) {
 		Configuration c;
@@ -66,6 +68,10 @@
 				Parameter parameter;
 				parameter.value = readNext(arguments, i);
 				currentQuery.parameters.push_back(parameter);
+			} else if (option == OPTION_FILE) {
+				c.file = readNext(arguments, i);
+			} else if (option == OPTION_KEEP_FILE) {
+				c.keepFile = true;
 			} else throw relpipe::cli::RelpipeCLIException(L"Unsupported CLI option: " + option, relpipe::cli::CLI::EXIT_CODE_BAD_CLI_ARGUMENTS);
 		}
 		addQuery(c, currentQuery); // last relation
@@ -79,11 +85,12 @@
 
 
 // relpipe-tr-sql --relation "tabulka" "SELECT * FROM fstab WHERE id = ?" --parameter "123"
-// TODO: --file db.sqlite --keep-file
 // TODO: --type string/integer/boolean (default is string)
 
 const string_t CLIParser::OPTION_RELATION = L"--relation";
 const string_t CLIParser::OPTION_PARAMETER = L"--parameter";
+const string_t CLIParser::OPTION_FILE = L"--file";
+const string_t CLIParser::OPTION_KEEP_FILE = L"--keep-file";
 
 }
 }