#!/usr/bin/env ruby $:.unshift(File.join(File.dirname(__FILE__), "..", "lib")) require "poolparty" require "poolpartycl" # # Get the git-style program action # o = PoolParty::Optioner.new(ARGV) do |opts, optioner| # opts.on('-n [name]','--name [name]', 'Binary to run') { |o| optioner.name o } # # opts.banner = <<-EOB # Usage: cloud # Cloud actions: # #{Binary.list_binaries_for("cloud")} # EOB # end name = ARGV.shift # If there was no program action given if !name || name == "-h" || name == "--help" puts "Binary required" puts <<-EOB Usage: cloud Cloud actions: #{Binary.list_binaries_for("cloud")} EOB exit 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: #{program_name}" end