diff --git a/README.md b/README.md index c5edca4..cbf6e64 100644 --- a/README.md +++ b/README.md @@ -11,4 +11,8 @@ This program work with ruby >= 1.9 * install ruby and rubygems on your computer * gem install mpw +If you want use mpw-ssh, you must install sshpass +# How to use + +mpw -h diff --git a/VERSION b/VERSION index 227cea2..38f77a6 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.0.0 +2.0.1 diff --git a/lib/mpw/ui/clissh.rb b/lib/mpw/ui/clissh.rb index 83d1d3b..0bf7bb0 100644 --- a/lib/mpw/ui/clissh.rb +++ b/lib/mpw/ui/clissh.rb @@ -12,15 +12,15 @@ class CliSSH < Cli # Connect to SSH # args: search -> string to search def ssh(search) - result = @mpw.search(search, nil, 'ssh') + result = @mpw.list(search: search, protocol: 'ssh') if result.length > 0 - result.each do |r| - server = @server.nil? ? r[:host] : @server - port = @port.nil? ? r[:port] : @port - login = @login.nil? ? r[:login] : @login + result.each do |item| + server = @server.nil? ? item.host : @server + port = @port.nil? ? item.port : @port + login = @login.nil? ? item.user : @login - passwd = r[:password] + passwd = item.password if port.nil? and port.empty? port = 22 diff --git a/mpw.gemspec b/mpw.gemspec index 21c33ed..aaf249a 100644 --- a/mpw.gemspec +++ b/mpw.gemspec @@ -13,7 +13,7 @@ Gem::Specification.new do |spec| spec.license = 'GPL' spec.files = `git ls-files -z`.split("\x0") - spec.executables = ['mpw', 'mpw-server'] + spec.executables = ['mpw', 'mpw-server', 'mpw-ssh'] spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) spec.require_paths = ['lib'] end