Created
December 8, 2014 12:50
-
-
Save drbig/5d6f806fe015aa5da7dc to your computer and use it in GitHub Desktop.
Pipe compiler errors to it.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# coding: utf-8 | |
require 'smart_colored' | |
STDIN.each_line do |l| | |
if m = l.match(%r{((/.*?)+)\:(\d+)}) | |
fn, _, ln = m.captures | |
next unless File.exist? fn | |
ln = ln.to_i | |
puts m.to_s.colored.bold | |
system "cat #{fn} | head -n#{ln+1} | tail -n#{3}" | |
print "\n" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment