Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Use env to find script interpreters
[simgrid.git] / tools / tesh / colorize.pl
1 #!/usr/bin/env perl
2
3 # Copyright (c) 2010, 2014. The SimGrid Team.
4 # All rights reserved.
5
6 # This program is free software; you can redistribute it and/or modify it
7 # under the terms of the license (GNU LGPL) which comes with this package.
8
9 use warnings;
10
11 use Term::ANSIColor qw{:constants};
12 $Term::ANSIColor::AUTORESET = 1;
13
14 while(<>){
15     if($_ =~ m/^(\d+\:\s)?[-]\s.*/){
16         print BOLD RED $_;
17     }elsif ($_ =~ m/^(\d+\:\s)?[+]\s.*/){
18         print BOLD GREEN $_;
19     }else{
20         print BOLD $_;
21     }
22 }
23
24