Class: Ppl::Command::Mutt

Inherits:
Application::Command show all
Defined in:
lib/ppl/command/mutt.rb

Instance Attribute Summary collapse

Attributes inherited from Application::Command

#storage

Instance Method Summary collapse

Methods inherited from Application::Command

add_property

Instance Attribute Details

#format=(value) ⇒ Object (writeonly)

Sets the attribute format

Parameters:

  • value

    the value to set the attribute format to.



6
7
8
# File 'lib/ppl/command/mutt.rb', line 6

def format=(value)
  @format = value
end

Instance Method Details

#execute(input, output) ⇒ Object



15
16
17
18
19
20
21
# File 'lib/ppl/command/mutt.rb', line 15

def execute(input, output)
  @options = input.options
  query = require_query(input)
  matches = mutt_search(query)
  output.line(describe_result(matches))
  matches.contacts.length > 0
end

#options(parser, options) ⇒ Object



8
9
10
11
12
13
# File 'lib/ppl/command/mutt.rb', line 8

def options(parser, options)
  parser.banner = "usage: ppl mutt <query>"
  parser.on("-i", "--ignore-case", "Turn off case sensitivity") do |i|
    options[:ignore_case] = i
  end
end