Remove handling for comma-separated specifications of targets to remove

This commit is contained in:
Martchus 2021-12-31 00:35:42 +01:00
parent 52edf572d4
commit 34282ebbe9
1 changed files with 3 additions and 10 deletions

View File

@ -497,18 +497,11 @@ void setTagInfo(const SetTagInfoArgs &args)
}
// determine targets to remove
vector<TagTarget> targetsToRemove;
bool validRemoveTargetsSpecified = false;
auto targetsToRemove = std::vector<TagTarget>();
for (size_t i = 0, max = args.removeTargetArg.occurrences(); i != max; ++i) {
auto &target = targetsToRemove.emplace_back();
for (const auto &targetDenotation : args.removeTargetArg.values(i)) {
targetsToRemove.emplace_back();
if (!strcmp(targetDenotation, ",")) {
if (validRemoveTargetsSpecified) {
targetsToRemove.emplace_back();
}
} else if (applyTargetConfiguration(targetsToRemove.back(), targetDenotation)) {
validRemoveTargetsSpecified = true;
} else {
if (!applyTargetConfiguration(target, targetDenotation)) {
cerr << Phrases::Error << "The given target specification \"" << targetDenotation << "\" is invalid." << Phrases::EndFlush;
exit(-1);
}