Skip to content

Instantly share code, notes, and snippets.

@shoorick
Created July 16, 2010 08:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shoorick/478159 to your computer and use it in GitHub Desktop.
Save shoorick/478159 to your computer and use it in GitHub Desktop.
Diff colorizer
#!/usr/bin/perl -n
use Term::ANSIColor;
print colored( $_, 'red' ) and next if /^</;
print colored( $_, 'green' ) and next if /^>/;
print colored( $_, 'bold blue' ) and next if /^[\d,]+[acd][\d,]+$/;
print;
=head1 NAME
Diff Colorizer
=head1 DESCRIPTION
Colorize output of diff: left parts becomes red, right ones becomes green and line numbers becomes bold blue
=head1 AUTHOR
Alexander Sapozhnikov
L<< http://shoorick.ru/ >>
L<< E<lt>shoorick@cpan.orgE<gt> >>
=cut
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment