May 14, 2003

Chimps and Monkeys - more custom output parsing

I created a batch file like this:

@echo off
echo c:\source\pnwtl\mainfrm.cpp:33: bananas.
echo monkey: c:\source\pnwtl\mainfrm.cpp (12)

I then went into tools->Options->Tools and added a tool to the batch file scheme. This tool basically says:

Run: %d%f
Directory: %d

I enabled capture output and selected "Use the built-in error parser".

I ran the tool, the first line:
c:\source\pnwtl\mainfrm.cpp:33: bananas
became a hotspot and clicking it jumped to line 33 in c:\source\pnwtl\mainfrm.cpp.

I then went back into options, double-clicked on the tool and selected "Look for a custom pattern". In the pattern box, I entered this:
(monkey|chimp): %f \(%l\)

I ran the tool again, and this time the line:
monkey: c:\source\pnwtl\mainfrm.cpp (12)
became a hotspot letting me jump to line 12 in mainfrm.cpp. The following line would also work:
chimp: c:\source\pnwtl\mainfrm.cpp (12)

Error parsing works on a line-by-line basis - therefore patterns can only match a single line. I don't think this is a problem - do you? Comment if you like.

Posted by Simon at May 14, 2003 04:36 PM