bin/rye in rye-0.8.5 vs bin/rye in rye-0.8.6
- old
+ new
@@ -7,11 +7,11 @@
#
# Usage: rye
#
$:.unshift File.join(File.dirname(__FILE__), '..', 'lib')
-#%w{net-ssh sysinfo drydock}.each { |dir| $:.unshift File.join(File.dirname(__FILE__), '..', '..', dir, 'lib') }
+%w{net-ssh net-scp sysinfo drydock}.each { |dir| $:.unshift File.join(File.dirname(__FILE__), '..', '..', dir, 'lib') }
require 'stringio'
require 'yaml'
require 'drydock'
require 'rye'
@@ -34,10 +34,24 @@
after do
end
+option :u, :user, String, "User name to connect as"
+option :i, :identity, String, "Private key"
+argv :host
+command :ssh do |obj|
+ raise "No host supplied" if obj.argv.empty?
+ opts = { :debug => true }
+ opts[:user] = obj.option.user || Rye.sysinfo.user
+ opts[:keys] = [obj.option.identity] || []
+ obj.argv.each do |host|
+ rbox = Rye::Box.new host, opts
+ p rbox.connect
+ end
+end
+
about "Add your public keys to one or more remote machines"
usage "rye authorize [-u username] host"
option :u, :user, String, "Username"
argv :hostname
command :authorize do |obj|
@@ -90,11 +104,11 @@
about "Display your private keys"
command :keys do |obj|
Rye.keys.each do |key|
- puts key.join(' ')
+ puts key
end
end
about "Display your public SSH keys"
usage "rye pubkeys [--pem] [KEYPATH]"
@@ -110,10 +124,10 @@
end
command_alias :pubkeys, :pubkey
default :keys
-debug :off
+debug :on
# We call Drydock specifically otherwise it will run at_exit. Rye also
# uses at_exit for shutting down the ssh-agent. Ruby executes at_exit
# blocks in reverse order so if Drydock is required first, it's block
# will run after Rye shuts down the ssh-agent.