--- a/src/CLIParser.h Sat Jan 19 21:16:39 2019 +0100
+++ b/src/CLIParser.h Sat Jan 19 21:21:26 2019 +0100
@@ -56,6 +56,7 @@
static const string_t OPTION_XATTR;
static const string_t OPTION_AS;
static const string_t OPTION_OPTION;
+ static const string_t OPTION_RELATION;
Configuration parse(const std::vector<string_t>& arguments) {
Configuration c;
@@ -78,6 +79,8 @@
} else if (option == OPTION_OPTION) {
currentOptions.push_back(readNext(arguments, i));
currentOptions.push_back(readNext(arguments, i));
+ } else if (option == OPTION_RELATION) {
+ c.relation = readNext(arguments, i);
} else {
throw relpipe::cli::RelpipeCLIException(L"Unsupported CLI option: " + option, relpipe::cli::CLI::EXIT_CODE_BAD_CLI_ARGUMENTS);
}
@@ -114,6 +117,7 @@
const string_t CLIParser::OPTION_XATTR = L"--" + RequestedField::GROUP_XATTR;
const string_t CLIParser::OPTION_AS = L"--as";
const string_t CLIParser::OPTION_OPTION = L"--option";
+const string_t CLIParser::OPTION_RELATION = L"--relation";
}
}
--- a/src/Configuration.h Sat Jan 19 21:16:39 2019 +0100
+++ b/src/Configuration.h Sat Jan 19 21:21:26 2019 +0100
@@ -29,6 +29,7 @@
class Configuration {
public:
+ string_t relation;
std::vector<RequestedField> fields;
virtual ~Configuration() {
--- a/src/FilesystemCommand.h Sat Jan 19 21:16:39 2019 +0100
+++ b/src/FilesystemCommand.h Sat Jan 19 21:21:26 2019 +0100
@@ -82,7 +82,8 @@
else throw RelpipeWriterException(L"Unsupported field group: " + field.group);
}
- writer->startRelation(L"filesystem", attributesMetadata, true);
+ string_t relationName = configuration.relation.empty() ? L"filesystem" : configuration.relation;
+ writer->startRelation(relationName, attributesMetadata, true);
for (std::stringstream originalName; readNext(input, originalName); reset(originalName)) {