Sha256: a5dcf674b0e52da7ea71b8e5e875f2bf7aaf37a2b46807d88d2425310837e244

Contents?: true

Size: 1.76 KB

Versions: 26

Compression:

Stored size: 1.76 KB

Contents

#!/usr/bin/env ruby
$:.unshift(File.dirname(__FILE__) + "/../lib")
require "poolparty"
require "colors"
require "mixins/printing"
require 'git-style-binary/command'

GitStyleBinary.primary do
  self.class.send :include, Printing
  
  @theme = :short
  
  version "PoolParty release: #{PoolParty.version}"
  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 :clouds_dot_rb, "Set the clouds.rb file", :type => String, :default => "clouds.rb"
  opt :very_verbose, "Set very verbose mode on", :type => :boolean, :default => false
  opt :debug, "Debug the output", :type => :boolean, :default => false
  opt :very_debug, "Set very debug mode on", :type => :boolean, :default => false
  opt :name, "Name of the working cloud", :type => String, :default => nil

  before_run do |command|
    # Setup testing/debugging
    $TESTING        = true if command[:verbose]
    $VERY_VERBOSE   = true if command[:very_verbose]
    $DEBUGGING      = true if command[:debug]
    $VERY_DEBUGGING = true if command[:very_debug]
    
    @loaded_pool = PoolParty::Pool.find_and_load_default_clouds_dot_rb(command[:clouds_dot_rb])
    @loaded_clouds = command[:name] ? [clouds[command[:name]]] : @loaded_pool.clouds.map {|name,cld|cld}
    @loaded_clouds.map 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

26 entries across 26 versions & 3 rubygems

Version Path
auser-poolparty-1.3.0 bin/cloud
auser-poolparty-1.3.1 bin/cloud
auser-poolparty-1.3.10 bin/cloud
auser-poolparty-1.3.11 bin/cloud
auser-poolparty-1.3.12 bin/cloud
auser-poolparty-1.3.13 bin/cloud
auser-poolparty-1.3.14 bin/cloud
auser-poolparty-1.3.15 bin/cloud
auser-poolparty-1.3.16 bin/cloud
auser-poolparty-1.3.2 bin/cloud
auser-poolparty-1.3.3 bin/cloud
auser-poolparty-1.3.4 bin/cloud
auser-poolparty-1.3.5 bin/cloud
auser-poolparty-1.3.6 bin/cloud
auser-poolparty-1.3.7 bin/cloud
auser-poolparty-1.3.8 bin/cloud
fairchild-poolparty-1.3.5 bin/cloud
poolparty-1.3.15 bin/cloud
poolparty-1.3.14 bin/cloud
poolparty-1.3.13 bin/cloud