Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use strict;
- use Term::ANSIColor qw(:constants);
- use vars qw($AUTORESET $EACHLINE);
- my @output;
- if ( -t STDIN ) {
- my $cla = join( " ", @ARGV );
- @output = `$cla`;
- }
- else {
- @output = (<STDIN>);
- }
- foreach my $line (@output) {
- $line =~ s/(^Index.*)/RED ON_CYAN $1 . RESET/eg;
- $line =~ s/(^={67}.*)/BOLD CYAN $1 . RESET/eg;
- $line =~ s/(^\@\@ .*)/BOLD BLUE $1 . RESET/eg;
- $line =~ s/(^\-\-\- .*)/REVERSE MAGENTA $1 . RESET/eg;
- $line =~ s/(^\+\+\+ .*)/REVERSE BLUE $1 . RESET/eg;
- $line =~ s/(^\+.*)/BOLD GREEN $1 . RESET/eg;
- $line =~ s/(^\-.*)/BOLD RED $1 . RESET/eg;
- print $line;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement