Sha256: 2bd59f61ef26271aba01fe376f038e070f257ec89d92d4bf42412f2c79275af3

Contents?: true

Size: 693 Bytes

Versions: 33

Compression:

Stored size: 693 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? ? ['id'] : %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

33 entries across 33 versions & 1 rubygems

Version Path
kontena-cli-1.3.5 lib/kontena/cli/volumes/list_command.rb
kontena-cli-1.3.5.rc1 lib/kontena/cli/volumes/list_command.rb
kontena-cli-1.4.0.rc1 lib/kontena/cli/volumes/list_command.rb
kontena-cli-1.4.0.pre14 lib/kontena/cli/volumes/list_command.rb
kontena-cli-1.4.0.pre13 lib/kontena/cli/volumes/list_command.rb
kontena-cli-1.4.0.pre12 lib/kontena/cli/volumes/list_command.rb
kontena-cli-1.4.0.pre11 lib/kontena/cli/volumes/list_command.rb
kontena-cli-1.4.0.pre10 lib/kontena/cli/volumes/list_command.rb
kontena-cli-1.4.0.pre9 lib/kontena/cli/volumes/list_command.rb
kontena-cli-1.4.0.pre8 lib/kontena/cli/volumes/list_command.rb
kontena-cli-1.4.0.pre7 lib/kontena/cli/volumes/list_command.rb
kontena-cli-1.4.0.pre6 lib/kontena/cli/volumes/list_command.rb
kontena-cli-1.4.0.pre5 lib/kontena/cli/volumes/list_command.rb
kontena-cli-1.4.0.pre4 lib/kontena/cli/volumes/list_command.rb
kontena-cli-1.4.0.pre3 lib/kontena/cli/volumes/list_command.rb
kontena-cli-1.4.0.pre2 lib/kontena/cli/volumes/list_command.rb
kontena-cli-1.4.0.pre1 lib/kontena/cli/volumes/list_command.rb
kontena-cli-1.3.4 lib/kontena/cli/volumes/list_command.rb
kontena-cli-1.3.4.rc1 lib/kontena/cli/volumes/list_command.rb
kontena-cli-1.3.3 lib/kontena/cli/volumes/list_command.rb