Sha256: a643b408f27d05603268cf69e2c93c5f8ffb499e7c319795904ff7d2c739738a

Contents?: true

Size: 1.45 KB

Versions: 4

Compression:

Stored size: 1.45 KB

Contents

#!/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|
    subcommands = GitStyleBinary.list_subcommands
    
    puts "Usage: cloud COMMAND [ARGS]
    
    The cloud subcommands commands are:
      #{subcommands}

    See 'cloud help COMMAND' for more information on a specific command."
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
auser-poolparty-1.2.10 bin/cloud
auser-poolparty-1.2.7 bin/cloud
auser-poolparty-1.2.8 bin/cloud
auser-poolparty-1.2.9 bin/cloud