class Skunk::Cli::Options::Argv

Extends RubyCritic::Cli::Options::Argv to parse a subset of the parameters accepted by RubyCritic

Attributes

output_filename[RW]

:reek: Attribute

Public Instance Methods

parse() click to toggle source
# File lib/skunk/cli/options/argv.rb, line 15
def parse # rubocop:disable Metrics/MethodLength
  parser.new do |opts|
    opts.banner = "Usage: skunk [options] [paths]\n"

    opts.on("-b", "--branch BRANCH", "Set branch to compare") do |branch|
      self.base_branch = String(branch)
      set_current_branch
      self.mode = :compare_branches
    end

    opts.on("-o", "--out FILE", "Output report to file") do |filename|
      self.output_filename = filename
    end

    opts.on_tail("-v", "--version", "Show gem's version") do
      self.mode = :version
    end

    opts.on_tail("-h", "--help", "Show this message") do
      self.mode = :help
    end
  end.parse!(@argv)
end
to_h() click to toggle source
Calls superclass method
# File lib/skunk/cli/options/argv.rb, line 39
def to_h
  super.merge(output_filename: output_filename)
end