mirror of
https://github.com/akuker/RASCSI.git
synced 2026-04-26 06:18:10 +00:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user