Sha256: df165a0e49fb1a18438fe295988606eb2112aecbbad4d65b42e8a337e100dfa6

Contents?: true

Size: 632 Bytes

Versions: 14

Compression:

Stored size: 632 Bytes

Contents

class Ppl::Command::Show < Ppl::Application::Command

  attr_writer :format

  def initialize
    @name        = "show"
    @description = "Display the full details of a contact"

    @format = Ppl::Format::Contact::Full.new
  end

  def options(parser, options)
    parser.banner = "usage: ppl show <contact>"
  end

  def execute(input, output)
    contact_id = input.arguments.shift
    if contact_id.nil?
      raise Ppl::Error::IncorrectUsage, "No contact specified"
    end

    contact   = @storage.require_contact(contact_id)
    formatted = @format.process(contact)

    output.line(formatted)
    return true
  end

end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
ppl-1.5.2 lib/ppl/command/show.rb
ppl-1.5.1 lib/ppl/command/show.rb
ppl-1.5.0 lib/ppl/command/show.rb
ppl-1.4.1 lib/ppl/command/show.rb
ppl-1.3.0 lib/ppl/command/show.rb
ppl-1.2.0 lib/ppl/command/show.rb
ppl-1.1.0 lib/ppl/command/show.rb
ppl-1.0.6 lib/ppl/command/show.rb
ppl-1.0.5 lib/ppl/command/show.rb
ppl-1.0.4 lib/ppl/command/show.rb
ppl-1.0.3 lib/ppl/command/show.rb
ppl-1.0.1 lib/ppl/command/show.rb
ppl-1.0.0 lib/ppl/command/show.rb
ppl-0.9.0 lib/ppl/command/show.rb