mirror of
https://github.com/nishiki/manage-password.git
synced 2024-11-27 07:33:05 +00:00
45 lines
841 B
Ruby
Executable file
45 lines
841 B
Ruby
Executable file
#!/usr/bin/ruby
|
|
# author: nishiki
|
|
# mail: nishiki@yaegashi.fr
|
|
# info: a simple script who manage your passwords
|
|
|
|
require 'rubygems'
|
|
require 'optparse'
|
|
require 'pathname'
|
|
|
|
APP_ROOT = File.dirname(Pathname.new(__FILE__).realpath)
|
|
require "#{APP_ROOT}/lib/CliSSH.rb"
|
|
|
|
cli = CliSSH.new()
|
|
search = ARGV[0]
|
|
|
|
options = {}
|
|
OptionParser.new do |opts|
|
|
opts.banner = "Usage: mpw-ssh SEARCH [options]"
|
|
|
|
opts.on("-l", "--login LOGIN", "Force a login") do |login|
|
|
cli.login = login
|
|
end
|
|
|
|
opts.on("-p", "--port PORT", "Force a port") do |port|
|
|
cli.port = port
|
|
end
|
|
|
|
opts.on("-s", "--server SERVER", "Force a server") do |server|
|
|
cli.server = server
|
|
end
|
|
|
|
opts.on("-h", "--help", "Show this message") do |b|
|
|
puts opts
|
|
exit 0
|
|
end
|
|
end.parse!
|
|
|
|
if ARGV.length < 1
|
|
puts "Usage: mpw-ssh SEARCH [options]"
|
|
exit 2
|
|
end
|
|
|
|
cli.ssh(search)
|
|
|
|
exit 0
|
|
|