Permalink
Browse files

nicer error message with invalid opts

  • Loading branch information...
1 parent 713389d commit 4fcc46b2c912ddd098d1df35a1a17249185bc1da @jnewland committed Dec 12, 2011
Showing with 6 additions and 1 deletion.
  1. +6 −1 bin/nagiosharder
View
@@ -38,7 +38,12 @@ optparse = OptionParser.new do |opts|
end
-optparse.parse!
+begin
+ optparse.parse!
+rescue OptionParser::InvalidOption => e
+ puts e.message
+ exit 1
+end
unless options['nagios_url'] && options['user'] && options['password']
puts "user, password, and nagios_url required"

0 comments on commit 4fcc46b

Please sign in to comment.