Sha256: 7430f06d257367c6dc318045465d309b4cc76156456a95084a4da90de183e011

Contents?: true

Size: 855 Bytes

Versions: 4

Compression:

Stored size: 855 Bytes

Contents

module Brightbox
  command [:images] do |cmd|

    cmd.desc "Show detailed image info"
    cmd.arg_name "image-id..."
    cmd.command [:show] do |c|

      c.action do |global_options, options, args|

        if args.empty?
          raise "You must specify the images you want to show"
        end

        images = Image.find_or_call(args) do |id|
          warn "Couldn't find image #{id}"
        end


        display_options = {
          :vertical => true,
          :fields => [
            :id, :type, :owner, :created_at, :status, :arch, :name,
            :description, :username, :virtual_size, :disk_size, :public,
            :"compatibility_mode", :official, :ancestor_id, :licence_name
          ]
        }

        table_opts = global_options.merge(display_options)

        render_table(images, table_opts)

      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
brightbox-cli-1.1.0 lib/brightbox-cli/commands/images-show.rb
brightbox-cli-1.0.0 lib/brightbox-cli/commands/images-show.rb
brightbox-cli-1.0.0.rc2 lib/brightbox-cli/commands/images-show.rb
brightbox-cli-1.0.0.rc1 lib/brightbox-cli/commands/images-show.rb