Sha256: ce294cfdd2e0264981d480671749c2b3a36bb3ce933edff2b2b71e2962601d50

Contents?: true

Size: 1.74 KB

Versions: 4

Compression:

Stored size: 1.74 KB

Contents

#!/usr/bin/env ruby
$:.unshift(File.dirname(__FILE__) + "/../lib")
require "poolparty"
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
    $PP_VERBOSE     = true if command[:verbose]
    $VERY_VERBOSE   = true if command[:very_verbose]
    $DEBUGGING      = true if command[:debug]
    $VERY_DEBUGGING = true if command[:very_debug]
    
    begin
      require command[:clouds_dot_rb]
    rescue LoadError => e
      puts "Failed loading #{command[:clouds_dot_rb]}, try using -c to specify the location of your clouds.rb"
      exit
    end
    
    @loaded_pool = pool
    @loaded_clouds = command[:name] ? [pool.clouds[command[:name]]] : pool.clouds.map {|name,cld|cld}    
  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
poolparty-1.6.1 bin/cloud
poolparty-1.6.0 bin/cloud
poolparty-1.5.0 bin/cloud
poolparty-1.4.8 bin/cloud