diff options
Diffstat (limited to 'lib/longboat')
-rw-r--r-- | lib/longboat/config.rb | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/lib/longboat/config.rb b/lib/longboat/config.rb index cd27bf9..dffbc08 100644 --- a/lib/longboat/config.rb +++ b/lib/longboat/config.rb @@ -27,15 +27,29 @@ module Longboat exit rescue Optimist::VersionNeeded exit + rescue Optimist::CommandlineError => e + puts "Command line error:" + puts e.message + puts + puts "Try --help, or refer to raider documentation." + exit 1 end end def self.for_raider(&block) parser = Optimist::Parser.new(&block) parser.ignore_invalid_options = true - opts = parser.parse - opts.delete(:help) - opts + begin + opts = parser.parse + opts.delete(:help) + opts + rescue Optimist::CommandlineError => e + puts "Command line error:" + puts e.message + puts + puts "Try --help, or refer to raider documentation." + exit 1 + end end end end |