From c675d2cb7c37c31cb4c7184328bfa5e62f5aa7a0 Mon Sep 17 00:00:00 2001 From: Johannes Zarl-Zierl Date: Thu, 7 May 2020 01:06:06 +0200 Subject: [PATCH] tagtool: convert --set-label to new tag syntax --- tools/tagtool/tagtool.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/tagtool/tagtool.sh b/tools/tagtool/tagtool.sh index f928c4c1eb..9486f9e424 100755 --- a/tools/tagtool/tagtool.sh +++ b/tools/tagtool/tagtool.sh @@ -56,7 +56,7 @@ Actions (only one action per invocation): limited to that language. --remove-tags TAG.. Remove the given tags. --rename-tag OLD NEW Rename the OLD tag to NEW tag in all files. ---set-label LABEL Set the given label on all given tag. +--set-label LABEL TAG Set the given label on all given tag. The tag is given as positional parameter. This action is limited to one language at a time, because the label is a localized string. @@ -165,6 +165,7 @@ setTagLabel() if [[ FORCE -eq 1 ]] then re_force_content="content=\"[^\"]*\"\W*" + re_force_content="|([^<]*)" fi echo "Setting label for tag $TagId to $Label.." >&2 for f in $(findTaggedFiles "$TagId") @@ -176,7 +177,7 @@ setTagLabel() continue fi echo " $f" >&2 - if ! performAction sed -E -i "s;\W*$TagId\W*\W*;$TagId;i" "$f" + if ! performAction sed -E -i "s;)$re_force_content)\W*;$Label;i" "$f" then echo "ERROR!" >&2 return 1