add implicit --copy '.*' only if no CLI arguments were specified (original behavior) v_0 v0.16
authorFrantišek Kučera <franta-hg@frantovo.cz>
Fri, 05 Jun 2020 18:26:27 +0200
branchv_0
changeset 49 1d17192565bf
parent 48 c83119110c7b
child 50 bb3268f87e25
add implicit --copy '.*' only if no CLI arguments were specified (original behavior)
src/relpipe-tr-sql.cpp
--- a/src/relpipe-tr-sql.cpp	Thu Jun 04 13:24:17 2020 +0200
+++ b/src/relpipe-tr-sql.cpp	Fri Jun 05 18:26:27 2020 +0200
@@ -61,7 +61,7 @@
 			SqlHandler::listDataSources(writer.get(), driverManager.get());
 		} else if (std::regex_match(cli.programName(), std::wregex(L"^(.*/)?relpipe-in-sql$"))) {
 			// relpipe-in-sql:
-			if (configuration.statements.size() == 0 && configuration.copyRelations.size() == 0) configuration.copyRelations.push_back({L".*", L"", false});
+			if (cli.arguments().size() == 0) configuration.copyRelations.push_back({L".*", L"", false});
 			configuration.sqlBeforeRelational = isatty(fileno(stdin)) ? nullptr : &std::wcin;
 			configuration.sqlAfterRelational = nullptr;
 			SqlHandler handler(writer.get(), driverManager.get(), configuration);