feat: New badge for default sub-options added in this version

This commit is contained in:
theupriser committed 2026-09-27 12:49:49 +02:00
1 parent c4280ecf60
commit 64536fe531
5 files changed
+21 -12

No files matched your search

+8 -5
View File
@@ -90,11 +90,14 @@ feature_outdated() {
menu_label() {
# The label, with "(update)" after the name when a newer version of it
# will be applied.
local l="${LABEL[$1]}"
if feature_outdated "$1"; then
if [[ "$l" == *:* ]]; then l="${l%%:*} ${c_yellow}(update)${c_reset}:${l#*:}"
else l+=" ${c_yellow}(update)${c_reset}"; fi
# will be applied, "(new)" for a default sub-option added since the
# last run.
local l="${LABEL[$1]}" b=""
if feature_outdated "$1"; then b="${c_yellow}(update)${c_reset}"
elif feature_new "$1"; then b="${c_green}(new)${c_reset}"; fi
if [[ -n "$b" ]]; then
if [[ "$l" == *:* ]]; then l="${l%%:*} $b:${l#*:}"
else l+=" $b"; fi
fi
printf '%s' "$l"
}