lib/ssh/manager/client.rb in ssh-manager-0.0.6 vs lib/ssh/manager/client.rb in ssh-manager-0.0.7
- old
+ new
@@ -1,9 +1,10 @@
#require_relative "../manager"
require 'optparse'
require_relative 'db'
require_relative 'client'
+require_relative 'version'
module SSH
module Manager
class Client
@@ -30,13 +31,19 @@
puts 'Listing ..'
cli.new(@options).list_all
elsif @options[:update]
puts 'Updating ..'
cli.new(@options).update(@options[:update])
+ elsif @options[:multi]
+ puts 'Connecting to multiple ips'
+ cli.new(@options).multiple_connection(@options[:multi])
elsif @options[:search]
puts 'Searching ..'
cli.new(@options).search_for(@options[:search])
+ # elsif @options[:settings]
+ # puts 'Settings'
+ # cli.new(@options).settings(@options[:settings])
else
cli.new(@argv.first).connect_to(@argv.first) if @argv != []
puts @optparse if @argv ==[]
exit
end
@@ -62,9 +69,13 @@
@options[:update] = opt
end
@options[:search] = false
opts.on( '-s', '--search string', 'search connection for given criteria' ) do |opt|
@options[:search] = opt
+ end
+ @options[:multi] = false
+ opts.on( '-m', '--multi string', 'connect to multiple ips with given criteria' ) do |opt|
+ @options[:multi] = opt
end
@options[:list] = false
opts.on( '-l', '--list', 'list all connections' ) do
@options[:list] = true
end