bin/cloud-osxcopy in auser-poolparty-1.2.2 vs bin/cloud-osxcopy in auser-poolparty-1.2.3

- old
+ new

@@ -1,17 +1,27 @@ #!/usr/bin/env ruby -$:.unshift(File.join(File.dirname(__FILE__), "..", "lib")) +$:.unshift(File.dirname(__FILE__) + "/../lib") require "poolparty" -require "poolpartycl" +# require "poolpartycl" +require 'git-style-binary/command' -o = PoolParty::Optioner.new(ARGV) do |opts, optioner| - opts.on('-n name', '--name name', 'Copy an ip from this cloud to the clipboard') { |c| optioner.cloudname c } -end +GitStyleBinary.command do + version "PoolParty #{$0} command" + banner <<-EOS +Usage: #{$0} #{all_options_string} COMMAND [ARGS] -o.loaded_clouds.each do |cld| - - node = cld.nodes(:status => "running").first - ip = node.ip - puts "ip: #{ip}" - Kernel.system "echo #{ip} | pbcopy" - + Copy the IP address of a node to the Mac OS X clipboard +EOS + + short_desc "Copy the IP address of a node to the Mac OS X clipboard" + + run do |command| + @loaded_clouds.each do |cld| + + node = cld.nodes(:status => "running").first + ip = node.ip + puts "ip: #{ip}" + Kernel.system "echo #{ip} | pbcopy" + + end + end end \ No newline at end of file