Sha256: 5ea7bafc8b6b90ebc354f63f4ce74b19b470749ea4e9dcf08cc6fbac01434b08

Contents?: true

Size: 470 Bytes

Versions: 14

Compression:

Stored size: 470 Bytes

Contents

class Ppl::Command::Ls < Ppl::Application::Command

  attr_writer :format

  def initialize
    @name        = "ls"
    @description = "List all contacts"

    @format = Ppl::Format::AddressBook::OneLine.new
  end

  def options(parser, options)
    parser.banner = "usage: ppl ls"
  end

  def execute(input, output)
    address_book = @storage.load_address_book
    formatted    = @format.process(address_book)

    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/ls.rb
ppl-1.5.1 lib/ppl/command/ls.rb
ppl-1.5.0 lib/ppl/command/ls.rb
ppl-1.4.1 lib/ppl/command/ls.rb
ppl-1.3.0 lib/ppl/command/ls.rb
ppl-1.2.0 lib/ppl/command/ls.rb
ppl-1.1.0 lib/ppl/command/ls.rb
ppl-1.0.6 lib/ppl/command/ls.rb
ppl-1.0.5 lib/ppl/command/ls.rb
ppl-1.0.4 lib/ppl/command/ls.rb
ppl-1.0.3 lib/ppl/command/ls.rb
ppl-1.0.1 lib/ppl/command/ls.rb
ppl-1.0.0 lib/ppl/command/ls.rb
ppl-0.9.0 lib/ppl/command/ls.rb