1
0
Fork 0
mirror of https://github.com/nishiki/manage-password.git synced 2025-02-20 01:50:04 +00:00

fix error message when there is a bad option

This commit is contained in:
Adrien Waksberg 2017-01-30 22:20:22 +01:00
parent 50aa7713f4
commit d6d7074341

View file

@ -21,6 +21,7 @@ $: << File.expand_path('../../lib', __FILE__)
require 'locale'
require 'set'
require 'i18n'
require 'colorize'
# --------------------------------------------------------- #
# Set local
@ -45,7 +46,11 @@ bin_dir = File.dirname(__FILE__)
command = "#{bin_dir}/mpw-#{ARGV[0]}"
if Dir.glob("#{bin_dir}/mpw-*").include?("#{command}")
Kernel.load(command)
begin
Kernel.load(command)
rescue Exception => e
puts "#{I18n.t('display.error')}: #{e}".red
end
else
puts "#{I18n.t('option.usage')}: mpw COMMAND [options]\n\n"
puts 'Commands:'