Sebastien Delafond pushed to branch gen-dsa-no-color at Debian Security Tracker 
/ security-tracker


Commits:
bbdca7ab by Sébastien Delafond at 2026-02-17T10:27:58+01:00
gen-DSA: add --no-color option

Argument order matters, as it doesn't use getopt.

- - - - -


1 changed file:

- bin/gen-DSA


Changes:

=====================================
bin/gen-DSA
=====================================
@@ -53,7 +53,7 @@ export LC_ALL=C
 }
 
 [ $# -ge 1 ] || {
-    echo "usage: $0 [--save] [--embargoed|--unembargo] [$IDMODE] 
package[.changes] [regression] [cve(s) [bugnumber(s)]] "
+    echo "usage: $0 [--save] [--embargoed|--unembargo] [--no-color] [$IDMODE] 
package[.changes] [regression] [cve(s) [bugnumber(s)]] "
     echo "       '$IDMODE' is the $IDMODE number, required when issuing a 
revision"
     echo "       'cve(s)' and 'bugnumber(s)' can be passed in any order but"
     echo "         always AFTER the description"
@@ -84,6 +84,13 @@ if [ "$1" = "--unembargo" ]; then
     set -- "$1"
 fi
 
+color=true
+if [ "$1" = "--no-color" ]; then
+    color=false
+    shift
+    set -- "$1"
+fi
+
 toupper() {
     printf '%s' "$1" | tr '[:lower:]' '[:upper:]'
 }
@@ -149,7 +156,7 @@ setvar() {
     sed -i "s=\$$var=$value=g" "$tmpf"
 }
 
-if command -v tput >/dev/null; then
+if $color && [ -z "$NO_COLOR" ] && command -v tput >/dev/null ; then
     RED=$(tput setaf 1)
     YELLOW=$(tput setaf 3)
     MAGENTA=$(tput setaf 5)



View it on GitLab: 
https://salsa.debian.org/security-tracker-team/security-tracker/-/commit/bbdca7ab6c8f8810b005cce8685047e150127085

-- 
View it on GitLab: 
https://salsa.debian.org/security-tracker-team/security-tracker/-/commit/bbdca7ab6c8f8810b005cce8685047e150127085
You're receiving this email because of your account on salsa.debian.org.


_______________________________________________
debian-security-tracker-commits mailing list
[email protected]
https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/debian-security-tracker-commits

Reply via email to