Sha256: 93a130f607386d2d9716dd3308d9e754324f75b7c02cf9ae69221bce8efae922

Contents?: true

Size: 693 Bytes

Versions: 2

Compression:

Stored size: 693 Bytes

Contents

require "optparse"
require "rubycritic"
require "rubycritic/orchestrators/main"

module Rubycritic

  OptionParser.new do |opts|
    opts.banner = "Usage: rubycritic [options] [paths]"

    opts.on("-p", "--path [PATH]", "Set path where report will be saved (tmp/rubycritic by default)") do |path|
      configuration.root = path
    end

    opts.on_tail("-v", "--version", "Show gem's version") do
      require "rubycritic/version"
      puts VERSION
      exit 0
    end

    opts.on_tail("-h", "--help", "Show this message") do
      puts opts
      exit 0
    end
  end.parse!

  ARGV << "." if ARGV.empty?
  puts "New critique at #{Orchestrator::Main.new.critique(ARGV)}"
  exit 0

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rubycritic-0.0.14 lib/rubycritic/cli.rb
rubycritic-0.0.13 lib/rubycritic/cli.rb