Skip to content

Commit 8e24cc8

Browse files
committed
DPL: syntactic sugar for --clone <template>:<instance number>
1 parent 4558beb commit 8e24cc8

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

Framework/Core/src/runDataProcessing.cxx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1408,7 +1408,17 @@ void overrideCloning(ConfigContext& ctx, WorkflowSpec& workflow)
14081408
}
14091409
auto key = token.substr(0, split);
14101410
token.erase(0, split + 1);
1411-
auto value = token;
1411+
size_t error;
1412+
std::string value = "";
1413+
try {
1414+
auto numValue = std::stoll(token, &error, 10);
1415+
if (token[error] != '\0') {
1416+
throw std::runtime_error("bad name for clone:" + token);
1417+
}
1418+
value = key + "_c" + std::to_string(numValue);
1419+
} catch (std::invalid_argument& e) {
1420+
value = token;
1421+
}
14121422
specs.push_back({key, value});
14131423
s.erase(0, newPos + (newPos == std::string::npos ? 0 : 1));
14141424
}

0 commit comments

Comments
 (0)