From 7c70174725195f23aa8e57023673ddbca8b615a1 Mon Sep 17 00:00:00 2001 From: rick Date: Mon, 30 Aug 2010 18:50:02 -0700 Subject: [PATCH] handle invalid options --- bin/gollum | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/bin/gollum b/bin/gollum index 603c8dd5..4e257208 100755 --- a/bin/gollum +++ b/bin/gollum @@ -37,7 +37,13 @@ opts = OptionParser.new do |opts| end # Read command line options into `options` hash -opts.parse! +begin + opts.parse! +rescue OptionParser::InvalidOption + puts "gollum: #{$!.message}" + puts "gollum: try 'gollum --help' for more information" + exit +end gollum_path = ARGV[0] || Dir.pwd