#!/usr/bin/env ruby $:.unshift(File.join(File.dirname(__FILE__), "..", "lib")) require "poolparty" require "poolpartycl" o = PoolParty::Optioner.new(ARGV) do |opts, optioner| opts.on('-n name', '--name name', 'Terminate the cloud of this name') { |c| optioner.cloudname c } end o.loaded_clouds.each do |cloud| with_cloud(cloud) do list_of_running_instances.each do |inst| puts "Shutting down #{inst.instance_id}" terminate_instance!(inst.instance_id) end end end