mirror of
https://github.com/nishiki/manage-password.git
synced 2025-02-20 01:50:04 +00:00
fix bug in mpw-ssh since add sync
This commit is contained in:
parent
2199e8cf8a
commit
352bc24f1a
2 changed files with 17 additions and 7 deletions
|
@ -12,7 +12,7 @@ class CliSSH < Cli
|
|||
# Connect to SSH
|
||||
# args: search -> string to search
|
||||
def ssh(search)
|
||||
result = @m.search(search, nil, 'ssh')
|
||||
result = @mpw.search(search, nil, 'ssh')
|
||||
|
||||
if result.length > 0
|
||||
result.each do |r|
|
||||
|
|
22
mpw-ssh
22
mpw-ssh
|
@ -39,20 +39,30 @@ OptionParser.new do |opts|
|
|||
options[:config] = config
|
||||
end
|
||||
|
||||
opts.on("-h", "--help", I18n.t('ssh.option.help')) do |b|
|
||||
opts.on("-h", "--help", I18n.t('ssh.option.help')) do
|
||||
puts opts
|
||||
exit 0
|
||||
end
|
||||
end.parse!
|
||||
|
||||
cli = CliSSH.new(lang, options[:config])
|
||||
cli.login = options[:login]
|
||||
cli.server = options[:server]
|
||||
cli.port = options[:port]
|
||||
config = MPWConfig.new(options[:config])
|
||||
check_error = config.checkconfig()
|
||||
|
||||
cli = CliSSH.new(lang, config)
|
||||
cli.login = options[:login]
|
||||
cli.server = options[:server]
|
||||
cli.port = options[:port]
|
||||
|
||||
search = ARGV[0]
|
||||
|
||||
if ARGV.length < 1
|
||||
cli.sync()
|
||||
|
||||
# Setup a new config
|
||||
if !check_error
|
||||
cli.setup(lang)
|
||||
|
||||
# Connect ssh
|
||||
elsif ARGV.length < 1
|
||||
puts "#{I18n.t('ssh.option.usage')}: mpw-ssh SEARCH [options]"
|
||||
exit 2
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue