[ditz-talk] How do I pass in the ignore_case option to ditz grep?

Matthew Wilson matt at tplus1.com
Fri Oct 3 14:43:22 EDT 2008


I'm reading the code in lib/ditz/operator.rb, and it seems like the
grep command / operator supports case-insensitive searches.

I can't figure out what to type at the command-line to enable
ignore_case in the code.  Any ideas?

Here's (I think) the relevant code from lib/ditz/operator.rb:

  operation :grep, "Show issues matching a string or regular
expression", :string do
    opt :ignore_case, "Ignore case distinctions in both the expression
and in the issue data", :default => false
  end

  def grep project, config, opts, match
    run_pager
    re = Regexp.new match, opts[:ignore_case]
    issues = project.issues.select do |i|
      i.title =~ re || i.desc =~ re ||
        i.log_events.map { |time, who, what, comments| comments
}.join(" ") =~ re
    end
    puts(todo_list_for(issues) || "No matching issues.")
  end

Matt

-- 
Matthew Wilson
matt at tplus1.com
http://tplus1.com
216-470-6058


More information about the ditz-talk mailing list