#!/usr/bin/env ruby $:.unshift(File.dirname(__FILE__) + "/../lib") require "poolparty" # require "poolpartycl" require 'git-style-binary/command' GitStyleBinary.primary do @theme = :short version "PoolParty cloud command" banner <<-EOS Usage: #{$0} #{all_options_string} COMMAND [ARGS] The cloud subcommands commands are: \#{GitStyleBinary.pretty_known_subcommands(:short).join(" ")} See 'cloud help COMMAND' for more information on a specific command. EOS opt :debug, "Debug the output", :type => :boolean, :default => false opt :spec, "Set the pool spec file", :type => String opt :testing, "Set testing mode on", :type => :boolean, :default => false opt :cloud_name, "Name of the working cloud", :type => String, :default => nil before_run do |command| # Setup testing/debugging $TESTING = true if command[:testing] $DEBUGGING = true if command[:debug] @loaded_pool = load_pool( command[:spec] ? command[:spec] : Binary.get_existing_spec_location) @loaded_clouds = command[:cloud_name] ? [clouds[command[:cloud_name].to_sym]] : clouds.map {|k,c| c } @loaded_clouds.each do |cld| cld.verbose command[:verbose] cld.debug command[:debug] end end run do |command| puts "Primary Options: #{command.opts.inspect}" end end