Sha256: a64ca4faf7dbd26826b82a7505098fb6ede4f69db667817dfce27f27b07391a6

Contents?: true

Size: 694 Bytes

Versions: 44

Compression:

Stored size: 694 Bytes

Contents

module Kontena::Cli::Volumes
  class ListCommand < Kontena::Command
    include Kontena::Util
    include Kontena::Cli::Common
    include Kontena::Cli::GridOptions
    include Kontena::Cli::TableGenerator::Helper

    option ['--[no-]long', '-l'], :flag, "Show full dates", default: !$stdout.tty?

    requires_current_master
    requires_current_master_token

    def volumes
      client.get("volumes/#{current_grid}")['volumes']
    end

    def fields
      quiet? ? ['name'] : %w(name scope driver created_at)
    end

    def execute
      print_table(volumes) do |row|
        next if long? || quiet?
        row['created_at'] = time_ago(row['created_at'])
      end
    end
  end
end

Version data entries

44 entries across 44 versions & 2 rubygems

Version Path
krates-1.7.11 lib/kontena/cli/volumes/list_command.rb
krates-1.7.10 lib/kontena/cli/volumes/list_command.rb
krates-1.7.9 lib/kontena/cli/volumes/list_command.rb
krates-1.7.8 lib/kontena/cli/volumes/list_command.rb
krates-1.7.7 lib/kontena/cli/volumes/list_command.rb
krates-1.7.6 lib/kontena/cli/volumes/list_command.rb
krates-1.7.5 lib/kontena/cli/volumes/list_command.rb
krates-1.7.4 lib/kontena/cli/volumes/list_command.rb
krates-1.7.3 lib/kontena/cli/volumes/list_command.rb
krates-1.7.2 lib/kontena/cli/volumes/list_command.rb
krates-1.7.1 lib/kontena/cli/volumes/list_command.rb
krates-1.7.0 lib/kontena/cli/volumes/list_command.rb
krates-1.6.9 lib/kontena/cli/volumes/list_command.rb
krates-1.6.8 lib/kontena/cli/volumes/list_command.rb
krates-1.6.7 lib/kontena/cli/volumes/list_command.rb
krates-1.6.6 lib/kontena/cli/volumes/list_command.rb
krates-1.6.5 lib/kontena/cli/volumes/list_command.rb
krates-1.6.4 lib/kontena/cli/volumes/list_command.rb
krates-1.6.3 lib/kontena/cli/volumes/list_command.rb
krates-1.6.2 lib/kontena/cli/volumes/list_command.rb