This class handles command line options.
# File lib/rubocop/options.rb, line 60 def parse(args) ignore_dropped_options(args) convert_deprecated_options(args) OptionParser.new do |opts| opts.banner = 'Usage: rubocop [options] [file1, file2, ...]' option(opts, '--only [COP1,COP2,...]') do |list| @options[:only] = list.split(',').map do |c| Cop::Cop.qualified_cop_name(c, '--only option') end validate_only_option end add_configuration_options(opts, args) add_formatting_options(opts) option(opts, '-r', '--require FILE') { |f| require f } add_severity_option(opts) add_flags_with_optional_args(opts) add_boolean_flags(opts) end.parse!(args) if (incompat = @options.keys & EXITING_OPTIONS).size > 1 fail ArgumentError, "Incompatible cli options: #{incompat.inspect}" end [@options, args] end
Generated with the Darkfish Rdoc Generator 2.