public
Description: Go plugins used by sbraford. Feel free to clone individually or as a whole.
Homepage:
Clone URL: git://github.com/sbraford/go-plugins.git
go-plugins / find.rb
100644 18 lines (14 sloc) 0.4 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
class Find < Go::Plugin
  call_with 'find'
  usage 'find <part_of_a_filename> (searches within current dir)'
  
  def run
    if @options.params.size < 1
      puts "Please provide a string to search on."
    else
      @filename = @options.params[0]
      puts "Searching for #{@filename} in current directory."
      @cmd = "find . | grep \"#{@filename}\""
      system(@cmd)
    end
  end
end