mirror of
https://github.com/nishiki/manage-password.git
synced 2025-02-18 17:10:04 +00:00
translate mpw-ssh options
This commit is contained in:
parent
8f3ab813e3
commit
fb55a4348f
4 changed files with 29 additions and 15 deletions
11
i18n/en.yml
11
i18n/en.yml
|
@ -91,8 +91,15 @@ en:
|
||||||
protocol: "Protocol"
|
protocol: "Protocol"
|
||||||
server: "Server"
|
server: "Server"
|
||||||
ssh:
|
ssh:
|
||||||
connect: "Connection to:"
|
option:
|
||||||
nothing: "Nothing result!"
|
usage: "Usage"
|
||||||
|
login: "Change the login"
|
||||||
|
server: "Change the host or the ip"
|
||||||
|
port: "Change the port"
|
||||||
|
help: "Show this help message"
|
||||||
|
display:
|
||||||
|
connect: "Connection to:"
|
||||||
|
nothing: "Nothing result!"
|
||||||
formats:
|
formats:
|
||||||
default: ! '%Y-%m-%d'
|
default: ! '%Y-%m-%d'
|
||||||
long: ! '%B %d, %Y'
|
long: ! '%B %d, %Y'
|
||||||
|
|
11
i18n/fr.yml
11
i18n/fr.yml
|
@ -91,8 +91,15 @@ fr:
|
||||||
protocol: "Protocol"
|
protocol: "Protocol"
|
||||||
server: "Serveur"
|
server: "Serveur"
|
||||||
ssh:
|
ssh:
|
||||||
connect: "Connexion à:"
|
option:
|
||||||
nothing: "Aucun résultat!"
|
usage: "Utilisation"
|
||||||
|
login: "Change l'identifiant de connexion"
|
||||||
|
server: "Change le nom de domaine ou l'ip du serveur"
|
||||||
|
port: "Change le port de connexion"
|
||||||
|
help: "Affiche ce message d'aide"
|
||||||
|
display:
|
||||||
|
connect: "Connexion à:"
|
||||||
|
nothing: "Aucun résultat!"
|
||||||
formats:
|
formats:
|
||||||
default: ! '%Y-%m-%d'
|
default: ! '%Y-%m-%d'
|
||||||
long: ! '%B %d, %Y'
|
long: ! '%B %d, %Y'
|
||||||
|
|
|
@ -26,7 +26,7 @@ class CliSSH < Cli
|
||||||
port = 22
|
port = 22
|
||||||
end
|
end
|
||||||
|
|
||||||
puts "#{I18n.t('ssh.connect')} ssh #{login}@#{server} -p #{port}"
|
puts "#{I18n.t('ssh.display.connect')} ssh #{login}@#{server} -p #{port}"
|
||||||
if passwd.empty?
|
if passwd.empty?
|
||||||
system("ssh #{login}@#{server} -p #{port}")
|
system("ssh #{login}@#{server} -p #{port}")
|
||||||
else
|
else
|
||||||
|
@ -35,7 +35,7 @@ class CliSSH < Cli
|
||||||
end
|
end
|
||||||
|
|
||||||
else
|
else
|
||||||
puts I18n.t('ssh.nothing')
|
puts I18n.t('ssh.display.nothing')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
18
mpw-ssh
18
mpw-ssh
|
@ -25,28 +25,28 @@ search = ARGV[0]
|
||||||
|
|
||||||
options = {}
|
options = {}
|
||||||
OptionParser.new do |opts|
|
OptionParser.new do |opts|
|
||||||
opts.banner = "Usage: mpw-ssh SEARCH [options]"
|
opts.banner = "#{I18n.t('ssh.option.usage')}: mpw-ssh SEARCH [options]"
|
||||||
|
|
||||||
opts.on("-l", "--login LOGIN", "Force a login") do |login|
|
opts.on("-l", "--login LOGIN", I18n.t('ssh.option.login')) do |login|
|
||||||
cli.login = login
|
cli.login = login
|
||||||
end
|
end
|
||||||
|
|
||||||
opts.on("-p", "--port PORT", "Force a port") do |port|
|
opts.on("-s", "--server SERVER", I18n.t('ssh.option.server')) do |server|
|
||||||
cli.port = port
|
|
||||||
end
|
|
||||||
|
|
||||||
opts.on("-s", "--server SERVER", "Force a server") do |server|
|
|
||||||
cli.server = server
|
cli.server = server
|
||||||
end
|
end
|
||||||
|
|
||||||
opts.on("-h", "--help", "Show this message") do |b|
|
opts.on("-p", "--port PORT", I18n.t('ssh.option.port')) do |port|
|
||||||
|
cli.port = port
|
||||||
|
end
|
||||||
|
|
||||||
|
opts.on("-h", "--help", I18n.t('ssh.option.help')) do |b|
|
||||||
puts opts
|
puts opts
|
||||||
exit 0
|
exit 0
|
||||||
end
|
end
|
||||||
end.parse!
|
end.parse!
|
||||||
|
|
||||||
if ARGV.length < 1
|
if ARGV.length < 1
|
||||||
puts "Usage: mpw-ssh SEARCH [options]"
|
puts "#{I18n.t('ssh.option.usage')}: mpw-ssh SEARCH [options]"
|
||||||
exit 2
|
exit 2
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue