diff --git a/i18n/en.yml b/i18n/en.yml index 3cfe0e0..f214e03 100644 --- a/i18n/en.yml +++ b/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' diff --git a/i18n/fr.yml b/i18n/fr.yml index f76c69c..2295d19 100644 --- a/i18n/fr.yml +++ b/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' diff --git a/lib/CliSSH.rb b/lib/CliSSH.rb index 6c99178..7e7d00b 100644 --- a/lib/CliSSH.rb +++ b/lib/CliSSH.rb @@ -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 diff --git a/mpw-ssh b/mpw-ssh index 0e9db73..c7962e1 100755 --- a/mpw-ssh +++ b/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