Class: Ppl::Command::Mutt
- Inherits:
-
Application::Command
- Object
- Application::Command
- Ppl::Command::Mutt
- Defined in:
- lib/ppl/command/mutt.rb
Instance Attribute Summary collapse
-
#format ⇒ Object
writeonly
Sets the attribute format.
Attributes inherited from Application::Command
Instance Method Summary collapse
Methods inherited from Application::Command
Instance Attribute Details
#format=(value) ⇒ Object (writeonly)
Sets the attribute format
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. 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 (parser, ) parser. = "usage: ppl mutt <query>" parser.on("-i", "--ignore-case", "Turn off case sensitivity") do |i| [:ignore_case] = i end end |