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:
parent
50aa7713f4
commit
d6d7074341
1 changed files with 6 additions and 1 deletions
7
bin/mpw
7
bin/mpw
|
@ -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:'
|
||||
|
|
Loading…
Add table
Reference in a new issue