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-3.0.1 lib/ppl/command/show.rb
ppl-3.0.0 lib/ppl/command/show.rb
ppl-2.4.1 lib/ppl/command/show.rb
ppl-2.4.0 lib/ppl/command/show.rb
ppl-2.3.3 lib/ppl/command/show.rb
ppl-2.3.2 lib/ppl/command/show.rb
ppl-2.3.1 lib/ppl/command/show.rb
ppl-2.3.0 lib/ppl/command/show.rb
ppl-2.2.0 lib/ppl/command/show.rb
ppl-2.1.0 lib/ppl/command/show.rb
ppl-2.0.0 lib/ppl/command/show.rb
ppl-1.25.0 lib/ppl/command/show.rb
ppl-1.24.0 lib/ppl/command/show.rb
ppl-1.23.0 lib/ppl/command/show.rb
ppl-1.22.2 lib/ppl/command/show.rb
ppl-1.22.1 lib/ppl/command/show.rb
ppl-1.22.0 lib/ppl/command/show.rb
ppl-1.21.0 lib/ppl/command/show.rb
ppl-1.20.0 lib/ppl/command/show.rb
ppl-1.19.0 lib/ppl/command/show.rb