Re: [PATCH] ver_linux: add comparison with required version and colour to output
From: Jonathan Corbet
Date: Fri Aug 14 2026 - 10:01:53 EST
Manuel Ebner <manuelebnerli@xxxxxxxxxxx> writes:
> Add the required version from changes.rst.
> Add code for comparison and print in colour (blue, green, red) depending
> on the result of the comparison.
>
> Signed-off-by: Manuel Ebner <manuelebnerli@xxxxxxxxxxx>
> ---
> I had this patch on my mind for more than half a year. I was convinced I
> couldn't do it because awk is such a special language. Took me less than
> an hour without AI - WTF
>
> Somehow I messed up the formating of the output. I guess it's this lines
> + ofmt = "%-20s\t%s\n"
> but I couldn't figure it out :(
> ---
> scripts/ver_linux | 109 +++++++++++++++++++++++++---------------------
> 1 file changed, 60 insertions(+), 49 deletions(-)
Honestly, I don't think this is going to go very far.
- You don't know that the output of the script is a terminal accepting
ANSI escapes.
- You don't know if the user is running in light or dark mode
- Color blindness must be taken into account
If you really want to add this feature, you need to make it selectable
and configurable. I honestly don't see that it would be worth it.
Thanks,
jon