mirror of
https://github.com/nishiki/manage-password.git
synced 2024-11-26 23:33:03 +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"
|
||||
server: "Server"
|
||||
ssh:
|
||||
connect: "Connection to:"
|
||||
nothing: "Nothing result!"
|
||||
option:
|
||||
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:
|
||||
default: ! '%Y-%m-%d'
|
||||
long: ! '%B %d, %Y'
|
||||
|
|
11
i18n/fr.yml
11
i18n/fr.yml
|
@ -91,8 +91,15 @@ fr:
|
|||
protocol: "Protocol"
|
||||
server: "Serveur"
|
||||
ssh:
|
||||
connect: "Connexion à:"
|
||||
nothing: "Aucun résultat!"
|
||||
option:
|
||||
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:
|
||||
default: ! '%Y-%m-%d'
|
||||
long: ! '%B %d, %Y'
|
||||
|
|
|
@ -26,7 +26,7 @@ class CliSSH < Cli
|
|||
port = 22
|
||||
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?
|
||||
system("ssh #{login}@#{server} -p #{port}")
|
||||
else
|
||||
|
@ -35,7 +35,7 @@ class CliSSH < Cli
|
|||
end
|
||||
|
||||
else
|
||||
puts I18n.t('ssh.nothing')
|
||||
puts I18n.t('ssh.display.nothing')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
18
mpw-ssh
18
mpw-ssh
|
@ -25,28 +25,28 @@ search = ARGV[0]
|
|||
|
||||
options = {}
|
||||
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
|
||||
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|
|
||||
opts.on("-s", "--server SERVER", I18n.t('ssh.option.server')) do |server|
|
||||
cli.server = server
|
||||
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
|
||||
exit 0
|
||||
end
|
||||
end.parse!
|
||||
|
||||
if ARGV.length < 1
|
||||
puts "Usage: mpw-ssh SEARCH [options]"
|
||||
puts "#{I18n.t('ssh.option.usage')}: mpw-ssh SEARCH [options]"
|
||||
exit 2
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue