My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
CommandLineSearch  
Search custom code repositories with CodeSearch-Plugin
Search-CommandLine
Updated Feb 19, 2007 by limpbiz...@gmail.com

CommandLineSearch

CommandLineSearch allows you to add custom search providers to the CodeSearch-Plugin easily.

Compatible commandline tools

To work with CodeSearch-Plugin, the commandline search utility must:

  • be executable from the command line, taking the search term as an argument
  • return results, one per line
  • each line must include a path to a file, a line number, and a code snippet.
  • each line must be machine-parsable using a simple regular expression

Example

I have a proprietary search tool for my code repository that works like this:

jessewilson$ /home/jessewilson/bin/codesearch /Repository/Projects HelloWorld
/Repository/Projects/GlazedLists/source/ca/odell/glazedlists/HelloWorld.java:12:public class HelloWorld {
/Repository/Projects/GlazedLists/source/ca/odell/glazedlists/HelloWorld.java:14:   public HelloWorld() {
/Repository/Projects/GlazedLists/source/ca/odell/glazedlists/HelloWorld.java:23:      System.out.println("HelloWorld");
/Repository/Projects/Riders/source/com/publicobject/Simulation2007.java:100:  // see this is a HelloWorld example of the API that

To configure this search tool, I use the following settings:

  • Executable /home/jessewilson/bin/codesearch
  • Arguments /Repository/Projects
  • Regular Expression ([^\:]+)\\:([^\:]+)\:(.*)
  • File Path Match 1
  • Line Number Match 2
  • Line Value Match 3
The regular expression uses Java Regex syntax. It should contain three groups (which are parts of the regular expression in round brackets), one for the file path, the line number and the line value.


Sign in to add a comment
Powered by Google Project Hosting