Sha256: bca09260964dfdfe197dd80b242d9ba6c5ea549107aeb48430e9a31374eaec0f

Contents?: true

Size: 622 Bytes

Versions: 38

Compression:

Stored size: 622 Bytes

Contents

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

  name        "show"
  description "Display the full details of a contact"

  attr_writer :format

  def initialize
    @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

38 entries across 38 versions & 1 rubygems

Version Path
ppl-1.18.0 lib/ppl/command/show.rb
ppl-1.17.2 lib/ppl/command/show.rb
ppl-1.17.1 lib/ppl/command/show.rb
ppl-1.17.0 lib/ppl/command/show.rb
ppl-1.16.0 lib/ppl/command/show.rb
ppl-1.15.1 lib/ppl/command/show.rb
ppl-1.15.0 lib/ppl/command/show.rb
ppl-1.14.1 lib/ppl/command/show.rb
ppl-1.14.0 lib/ppl/command/show.rb
ppl-1.13.0 lib/ppl/command/show.rb
ppl-1.12.0 lib/ppl/command/show.rb
ppl-1.11.0 lib/ppl/command/show.rb
ppl-1.10.0 lib/ppl/command/show.rb
ppl-1.9.0 lib/ppl/command/show.rb
ppl-1.8.0 lib/ppl/command/show.rb
ppl-1.7.0 lib/ppl/command/show.rb
ppl-1.6.0 lib/ppl/command/show.rb
ppl-1.5.3 lib/ppl/command/show.rb