Module: YardJunk::CommandLineOptions

Defined in:
lib/yard-junk/command_line.rb

Instance Method Summary collapse

Instance Method Details

#common_options(opts) ⇒ Object

rubocop:disable Metrics/MethodLength



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/yard-junk/command_line.rb', line 5

def common_options(opts) # rubocop:disable Metrics/MethodLength
  super

  opts.separator ''
  opts.separator 'YardJunk plugin options'

  opts.on('--junk-log-format [FMT]',
          'YardJunk::Logger format string, by default ' \
          "#{Logger::Message::DEFAULT_FORMAT.inspect}") do |format|
    Logger.instance.format = format
  end

  opts.on('--junk-log-ignore [TYPE1,TYPE2,...]',
          'YardJunk::Logger message types to ignore, by default ' \
          "#{Logger::DEFAULT_IGNORE.map(&:inspect).join(', ')}") do |ignore|
    Logger.instance.ignore = ignore.to_s.split(',')
  end

  opts.separator ''
  opts.separator 'Generic options'
end