class Bundler::Thor

def check_unknown_options?(config) #:nodoc:

:nodoc:
Overwrite check_unknown_options? to take subcommands and options into account.
def check_unknown_options?(config) #:nodoc:
  options = check_unknown_options
  return false unless options
  command = config[:current_command]
  return true unless command
  name = command.name
  if subcommands.include?(name)
    false
  elsif options[:except]
    !options[:except].include?(name.to_sym)
  elsif options[:only]
    options[:only].include?(name.to_sym)
  else
    true
  end
end