Sha256: dfa45267833611979d8aec1feb01124cf893d7df7683a231d6fde0e839093713
Contents?: true
Size: 1.06 KB
Versions: 27
Compression:
Stored size: 1.06 KB
Contents
#!/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('-f [remote|local]', '--from [remote|local]', 'Remote or local (default: local)') { |o| optioner.location o } opts.on('-r', '--remote', 'Remote listing') { optioner.location "remote" } opts.on('-l', '--local', 'Local listing') { optioner.location "local" } opts.on('-n name', '--name name', 'Listing for pool name') { |p| optioner.poolname p } end load_pool(o.spec || Binary.get_existing_spec_location) @location = o.location ? o.location : "remote" include Remote @pools = o.poolname ? [pool(o.poolname.downcase.to_sym)] : pools @pools.each do |name, pool| with_pool(pool, {:location => @location}) do puts header("Listing pool #{name}") clouds.each do |name, cloud| puts subheader("Cloud: #{name}") out = location == "remote" ? cloud.list_from_remote({:cache => true}).map{|a| a.to_s} : cloud.list_from_local.map{|a| a.to_s} puts out end end end
Version data entries
27 entries across 27 versions & 2 rubygems