Add statistics and make scsictl accept generic key/value parameters (#1237/#1238) (#1262)

* Add statistics and make scsictl accept generic key/value parameters
This commit is contained in:
Uwe Seimet
2023-10-30 13:32:45 +01:00
committed by GitHub
parent 8f45e4f491
commit b7cb23e391
26 changed files with 557 additions and 105 deletions
+19 -7
View File
@@ -42,21 +42,33 @@ void protobuf_util::ParseParameters(PbDeviceDefinition& device, const string& pa
}
}
void protobuf_util::SetPatternParams(PbCommand& command, const string& patterns)
void protobuf_util::SetCommandParams(PbCommand& command, const string& params)
{
string folder_pattern;
string file_pattern;
string operations;
if (const auto& components = Split(patterns, ':', 2); components.size() == 2) {
folder_pattern = components[0];
file_pattern = components[1];
}
else {
file_pattern = patterns;
switch (const auto& components = Split(params, COMPONENT_SEPARATOR, 3); components.size()) {
case 3:
operations = components[2];
[[fallthrough]];
case 2:
folder_pattern = components[0];
file_pattern = components[1];
break;
case 1:
file_pattern = components[0];
break;
default:
break;
}
SetParam(command, "folder_pattern", folder_pattern);
SetParam(command, "file_pattern", file_pattern);
SetParam(command, "operations", operations);
}
void protobuf_util::SetProductData(PbDeviceDefinition& device, const string& data)