bin/ridgepole in ridgepole-0.7.0.beta6 vs bin/ridgepole in ridgepole-0.7.0.beta7

- old
+ new

@@ -42,11 +42,11 @@ :debug => false, :color => $stdout.tty?, } set_mode = proc do |m| - raise 'More than one mode is specified' if mode + raise OptionParser::InvalidOption, 'More than one mode is specified' if mode mode = m end def noop_migrate(delta, options) unless delta.script.empty? @@ -81,11 +81,11 @@ opt.on('', '--dry-run') { options[:dry_run] = true } opt.on('', '--table-options OPTIONS') {|v| options[:table_options] = v } opt.on('', '--alter-extra ALTER_SPEC') {|v| options[:alter_extra] = v } opt.on('', '--external-script SCRIPT') {|v| options[:external_script] = v } opt.on('', '--bulk-change') { - raise "Cannot use `bulk-change` in `merge`" if options[:merge] + raise OptionParser::InvalidOption, "Cannot use `bulk-change` in `merge`" if options[:merge] options[:bulk_change] = true } COLUMN_TYPES.each do |column_type, column_type_alias| opt.on('', "--default-#{column_type_alias}-limit LIMIT", Integer) {|v| @@ -138,10 +138,14 @@ puts opt.help exit 1 end rescue => e $stderr.puts("[ERROR] #{e.message}") - puts e.backtrace + + unless e.kind_of?(OptionParser::InvalidOption) + puts "\t" + e.backtrace.join("\n\t") + end + exit 1 end end begin