--- a/src/relpipe-in-filesystem.cpp Sun Jan 19 18:41:32 2020 +0100
+++ b/src/relpipe-in-filesystem.cpp Mon Jan 20 12:39:22 2020 +0100
@@ -30,6 +30,7 @@
#include <relpipe/cli/RelpipeCLIException.h>
#include "FilesystemCommand.h"
+#include "ParallelFilesystemCommand.h"
#include "CLIParser.h"
using namespace relpipe::cli;
@@ -46,8 +47,10 @@
try {
CLIParser cliParser;
Configuration configuration = cliParser.parse(cli.arguments());
- FilesystemCommand command;
- command.process(cin, cout, configuration);
+ std::unique_ptr<FilesystemCommandBase> command;
+ if (configuration.parallelism == 1) command = std::make_unique<FilesystemCommand>();
+ else command = std::make_unique<ParallelFilesystemCommand>();
+ command->process(cin, cout, configuration);
resultCode = CLI::EXIT_CODE_SUCCESS;
} catch (RelpipeWriterException e) {
fwprintf(stderr, L"Caught Writer exception: %ls\n", e.getMessge().c_str());