Sha256: 024bedaaf6052e4eba182edcf4f9d94ed69da9765e1423a3041ec8347288be44

Contents?: true

Size: 493 Bytes

Versions: 8

Compression:

Stored size: 493 Bytes

Contents

module Brightbox
  desc 'Destroy images'
  arg_name 'image-id...'
  command [:destroy] do |c|

    c.action do |global_options,options,args|

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

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

      images.each do |i|
        info "Destroying image #{i}"
        i.destroy
        i.reload
      end

      render_table(images)

    end
  end
end

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
brightbox-cli-0.16.0 lib/brightbox-cli/commands/images-destroy.rb
brightbox-cli-0.15.0 lib/brightbox-cli/commands/images-destroy.rb
brightbox-cli-0.14.1 lib/brightbox-cli/commands/images-destroy.rb
brightbox-cli-0.14.0 lib/brightbox-cli/commands/images-destroy.rb
brightbox-cli-0.13.1 lib/brightbox-cli/commands/images-destroy.rb
bbcloud-0.13.0 lib/bbcloud/commands/images-destroy.rb
brightbox-cli-0.13.0 lib/brightbox-cli/commands/images-destroy.rb
bbcloud-0.12.0 lib/bbcloud/commands/images-destroy.rb