Method: Bundler::Thor.check_unknown_options?

Defined in:
lib/bundler/vendor/thor/lib/thor.rb

.check_unknown_options?(config) ⇒ Boolean

Overwrite check_unknown_options? to take subcommands and options into account.

Returns:

  • (Boolean)


268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
# File 'lib/bundler/vendor/thor/lib/thor.rb', line 268

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