commit:     858cf068305e58a918ad60cc0337b8dc13e75cf5
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Mon Nov 15 08:03:07 2021 +0000
Commit:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Mon Nov 15 13:46:19 2021 +0000
URL:        https://gitweb.gentoo.org/data/api.git/commit/?id=858cf068

used_free_uidgids.sh: Make the recommended IDs stand out

By moving this output to the end and adding some colour.

Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org>

 bin/used_free_uidgids.sh | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/bin/used_free_uidgids.sh b/bin/used_free_uidgids.sh
index 1838f11..dae2517 100755
--- a/bin/used_free_uidgids.sh
+++ b/bin/used_free_uidgids.sh
@@ -305,9 +305,14 @@ for r in "${selection_ranges[@]}"; do
        (( free_total_pair += freepair ))
 done
 
-echo "Recommended GID only: ${gidonly:-${uidgidboth:-none}}"
-echo "Recommended UID only: ${uidonly:=${uidgidboth:-none}}"
-echo "Recommended UID+GID pair: ${uidgidboth:-none}"
 echo "Free UIDs: ${free_total_uid}"
 echo "Free GIDs: ${free_total_gid}"
 echo "Free UID+GID pairs: ${free_total_pair}"
+echo
+
+for out in "Recommended GID only: ${gidonly:-${uidgidboth:-none}}" \
+          "Recommended UID only: ${uidonly:-${uidgidboth:-none}}" \
+          "Recommended UID+GID pair: ${uidgidboth:-none}"; do
+    [[ ${out} == *none ]] && colour=${colour_USED} || colour=${colour_FREE}
+    echo -e "${out%%: *}: ${colour}${out#*: }${colour_RESET}"
+done

Reply via email to