Skip to content

Instantly share code, notes, and snippets.

@zbyhoo
Created Jan 10, 2011
Embed
What would you like to do?
Ruby script converting gcc output to msvc compatible one (go to line when error appears).
result = 0
while (line = gets)
index = line.index(/\.[ch]pp\:[0-9]/)
if (index == nil)
puts line
else
path_end = line.index(":", index)
linenr_end = line.index(":", path_end + 1)
filepath = line[0,path_end]
linenr = line[(path_end+1)...linenr_end]
message = line[(linenr_end+2)..line.length]
puts "#{filepath}(#{linenr}) : #{message}"
result = 1
end
end
exit result
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment