When you write:

  opts.on('-d', '--database', 'comments go here') do |x|
    options[:database] = x
  end

'x' will be set to 'true', not the input value you expect.  If you want 
flags with values, you need to include a "VAL" placeholder:

  opts.on('-d VAL', '--database VAL', 'comments go here') do |x|
    options[:database] = x
  end

Then 'x' will hold the value after the -d flag.

-- 
Posted via http://www.ruby-forum.com/.