#!/usr/bin/env ruby $:.unshift(File.dirname(__FILE__) + "/../lib") require "poolparty" require 'git-style-binary/command' GitStyleBinary.command do banner <<-EOS Usage: #{$0} #{all_options_string} ssh into an instance of the cloud EOS short_desc "ssh into an instance of the cloud" opt :instance_number, "Ssh into the instance number", :type => :integer, :default => 0 run do |command| cloud = @loaded_clouds.first if !cloud.nodes.empty? inst = cloud.nodes[command[:instance_number]] inst ? inst.ssh : puts("Error: The instance number (#{command[:instance_number]}) is too high for the current number of instances") else puts "No running instances can be found" end end end