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.6.1 lib/kontena/cli/volumes/list_command.rb
krates-1.6.0 lib/kontena/cli/volumes/list_command.rb
kontena-cli-1.5.4 lib/kontena/cli/volumes/list_command.rb
kontena-cli-1.5.4.rc1 lib/kontena/cli/volumes/list_command.rb
kontena-cli-1.5.3 lib/kontena/cli/volumes/list_command.rb
kontena-cli-1.5.2 lib/kontena/cli/volumes/list_command.rb
kontena-cli-1.5.1 lib/kontena/cli/volumes/list_command.rb
kontena-cli-1.5.0 lib/kontena/cli/volumes/list_command.rb
kontena-cli-1.5.0.rc1 lib/kontena/cli/volumes/list_command.rb
kontena-cli-1.5.0.pre5 lib/kontena/cli/volumes/list_command.rb
kontena-cli-1.5.0.pre4 lib/kontena/cli/volumes/list_command.rb
kontena-cli-1.5.0.pre3 lib/kontena/cli/volumes/list_command.rb
kontena-cli-1.5.0.pre2 lib/kontena/cli/volumes/list_command.rb
kontena-cli-1.5.0.pre1 lib/kontena/cli/volumes/list_command.rb
kontena-cli-1.4.3 lib/kontena/cli/volumes/list_command.rb
kontena-cli-1.4.3.rc1 lib/kontena/cli/volumes/list_command.rb
kontena-cli-1.4.2 lib/kontena/cli/volumes/list_command.rb
kontena-cli-1.4.2.rc1 lib/kontena/cli/volumes/list_command.rb
kontena-cli-1.4.2.pre1 lib/kontena/cli/volumes/list_command.rb
kontena-cli-1.4.1 lib/kontena/cli/volumes/list_command.rb