Hall of Shame

This commit is contained in:
bar 2011-05-18 02:52:05 +02:00
parent e970a440fa
commit bdc428ff98

View file

@ -87,6 +87,7 @@ Valid commands:
give [<account>] [<amount>] Transfer money to user's account give [<account>] [<amount>] Transfer money to user's account
take [<accounts>] [<amount>] Take money from users (equal parts) take [<accounts>] [<amount>] Take money from users (equal parts)
list List accounts and balances list List accounts and balances
shame Display Hall of Shame (negative balances)
undo [<id>] Undo a certain transaction undo [<id>] Undo a certain transaction
help The stuff you're looking at right now :) help The stuff you're looking at right now :)
examples Show some usage examples examples Show some usage examples
@ -232,6 +233,8 @@ sub parse_command {
return undo($line); return undo($line);
} elsif ($command =~ /^(?:ls|list)$/) { } elsif ($command =~ /^(?:ls|list)$/) {
return list(); return list();
} elsif ($command =~ /^(?:shame)$/) {
return shame();
} elsif ($command =~ /^(?:edit)$/) { } elsif ($command =~ /^(?:edit)$/) {
return edit(); return edit();
} }
@ -391,6 +394,11 @@ sub list {
return ['noop']; return ['noop'];
} }
sub shame {
system "sort -f revbank.accounts | grep -v ^# | grep -- ' -' | more";
return ['noop'];
}
sub edit { sub edit {
system "vim revbank.products"; system "vim revbank.products";
return ['noop']; return ['noop'];