When I changed jobs to my current employer, I found myself in a Microsoft shop I was a fish out of water. I come from a Unix background where the use of command-line tools rather than a GUI was the normal mode of operation. I strongly suggest installing Cygwin even if you have no interest in GrepWrap as it has hundreds of incredibly useful utilities running from the mundane awk program to a complete X-Windows server! And the price is right. Note: I do not include grep.exe in this article as it is freely available by installing Cygwin. However, I have looked at them and they do not meet my particular needs, although they seem to be fine utilities. In fact, until I started to write this article, I was only vaguely aware of some of these others. It has nothing to do with other programs with similar names, such as TortoisesVN grepWin or Windows Grep. Note: in the original version of this article, I was using the name GrepWin, which is the same as another tool by TortoisesVN. So my solution is GrepWrap, which is just a simple wrapper around GNU Grep. There was a match found on line 76 of MainFrm.cpp. The output has coloring and context to help identify the match. This is a recursive search in the current directory for C/C files, avoiding the Release and Debug directories, for the pattern ' toolbar.*color'. exclude-dir='Release' -regexp='toolbar.*color' -include="*.cpp" \ binary-files=without-match -P -recursive -i -exclude-dir='Debug' \ Grep -with-filename -line-number -C2 -devices=skip -color=always \ The above is slightly more easily read as: It just seemed that I was missing something. I have always found the command-line utility grep to be useful for brute-force searching of patterns in text files (especially code source!), but the number of options is daunting and when the search is finished, I always have to manually find the matching file and open it up and scroll to the correct line. Version 1.6 - Fixed a bug with files that don't have a default system handler.Version 1.5 - Added 'Programs' menu item to indicate location of grep.exe, misc cleanup.Version 1.4 - Replaced demo.zip with an installable (and new name).Version 1.3 - Initial inflicted upon release to CodeProject.Versions 1.0 to 1.2 - Personal use only versions.
0 Comments
Leave a Reply. |