Sha256: 1e04fa2d26ba3d5a46968f236c9096be06a26f139f35616e063823eb448c0c5b

Contents?: true

Size: 1.45 KB

Versions: 46

Compression:

Stored size: 1.45 KB

Contents

#!/usr/bin/env ruby
$:.unshift(File.join(File.dirname(__FILE__), "..", "lib"))
require "poolparty"
require "poolpartycl"

name = ARGV.select {|arg| arg if Binary.available_binaries_for("cloud").include?(arg) }.first
# If the options include -h and they don't include a valid command, then we can just pass the 
# original options back, but if they do contain a binary, we don't want -h getting through to 
# these options, so we'll strip it if it's included
DUP_ARG = ARGV.dup
new_args = DUP_ARG.map {|arg| DUP_ARG.delete(arg) unless help_array.include?(arg) || Binary.available_binaries_for("cloud").include?(arg) }
new_args = new_args.reject {|arg| Binary.available_binaries_for("cloud").include?(arg) }.empty? ? ARGV : (name ? (help_array.each {|arg| DUP_ARG.delete(arg)}; DUP_ARG) : DUP_ARG)

# Let's make sure if no command is passed in that we show the help message
new_args.push("-h") unless name

o = PoolParty::Optioner.new(new_args, {:extra_help => "\nCloud actions\n#{Binary.list_binaries_for("cloud")}\n\n", :abstract => true}) do |opts, optioner|  
  opts.on('-n cloudname', '--name name', 'Address this cloud')    { |c| optioner.cloudname c }
end

program_name = "#{File.basename($0)}-#{name}"
program_location = File.join(Binary.binary_directory, program_name)

command_line = "#{program_location}"

# Run it from the command-line first
if Binary.available_binaries_for("cloud").include?(name)
  system command_line, *ARGV
else
  puts "Unknown poolparty binary: #{name}"
end

Version data entries

46 entries across 46 versions & 2 rubygems

Version Path
auser-poolparty-0.2.46 bin/cloud
auser-poolparty-0.2.47 bin/cloud
auser-poolparty-0.2.48 bin/cloud
auser-poolparty-0.2.49 bin/cloud
auser-poolparty-0.2.50 bin/cloud
auser-poolparty-0.2.51 bin/cloud
auser-poolparty-0.2.52 bin/cloud
auser-poolparty-0.2.53 bin/cloud
auser-poolparty-0.2.54 bin/cloud
auser-poolparty-0.2.55 bin/cloud
auser-poolparty-0.2.56 bin/cloud
auser-poolparty-0.2.57 bin/cloud
auser-poolparty-0.2.58 bin/cloud
auser-poolparty-0.2.59 bin/cloud
auser-poolparty-0.2.60 bin/cloud
auser-poolparty-0.2.61 bin/cloud
auser-poolparty-0.2.62 bin/cloud
auser-poolparty-0.2.63 bin/cloud
auser-poolparty-0.2.64 bin/cloud
auser-poolparty-0.2.65 bin/cloud