From a18ef9939ad150a8ebfa21fd6727d3d7d710b80a Mon Sep 17 00:00:00 2001 From: Juerd Waalboer Date: Tue, 1 Nov 2022 04:45:59 +0100 Subject: [PATCH] Sort shame --- plugins/users | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/plugins/users b/plugins/users index 5249a45..906a872 100644 --- a/plugins/users +++ b/plugins/users @@ -37,7 +37,12 @@ sub list($self) { } sub shame($self) { - my $list = join "", sort grep / -/ && !/^[-+]/, slurp("revbank.accounts"); + my $list = join "", sort { + (split " ", $a)[1] <=> (split " ", $b)[1] + } grep { + / -/ && !/^[-+]/ + } slurp("revbank.accounts"); + $list =~ s/( -[\d.]+)/\e[31;1m$1\e[0m/g; print $list; return ACCEPT;