Permalink
Browse files

Nicer error message on option parsing failures

  • Loading branch information...
Justin Collins Dave Worth
Justin Collins authored and Dave Worth committed Apr 13, 2012
1 parent 044e4c8 commit a96f67728817873934725bd7645b0585abe17d18
Showing with 7 additions and 1 deletion.
  1. +7 −1 bin/brakeman
View
@@ -7,7 +7,13 @@ require 'brakeman/options'
require 'brakeman/version'
#Parse options
-options, parser = Brakeman::Options.parse! ARGV
+begin
+ options, parser = Brakeman::Options.parse! ARGV
+rescue OptionParser::ParseError => e
+ $stderr.puts e.message.capitalize
+ $stderr.puts "Please see `brakeman --help` for valid options"
+ exit
+end
#Exit early for these options
if options[:list_checks]

0 comments on commit a96f677

Please sign in to comment.