users: color negative balance red
This commit is contained in:
parent
acb47457c1
commit
0202ab38ac
1 changed files with 3 additions and 1 deletions
|
@ -97,7 +97,9 @@ sub _recent($n, $u) {
|
||||||
sub balance($self, $u) {
|
sub balance($self, $u) {
|
||||||
_recent(10, $u);
|
_recent(10, $u);
|
||||||
call_hooks("user_info", $u);
|
call_hooks("user_info", $u);
|
||||||
printf "Balance for $u is \e[1m%s\e[0m\n", RevBank::Users::balance($u)->string("+");
|
my $balance = RevBank::Users::balance($u);
|
||||||
|
my $red = $balance->cents < 0 ? "31;" : "";
|
||||||
|
printf "Balance for $u is \e[%s1m%s\e[0m\n", $red, $balance->string("+");
|
||||||
say "NB: Products/amounts/commands FIRST, username LAST.";
|
say "NB: Products/amounts/commands FIRST, username LAST.";
|
||||||
return ABORT;
|
return ABORT;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue