Sha256: 74320d35521d0e63fcf93864d414fb8f48b758a2431e26faf1f57ff78b28c046

Contents?: true

Size: 1.16 KB

Versions: 1

Compression:

Stored size: 1.16 KB

Contents

#!/usr/bin/env ruby
# frozen_string_literal: true

require 'optparse'
require 'massa'

$LOAD_PATH.push File.expand_path('../lib', __dir__)

options = {}

OptionParser.new do |opts|
  opts.banner = 'Usage: massa [options]'

  opts.on('-g', '--generate-config', 'Generate config file') do
    template    = File.expand_path('../lib/massa/templates/massa.yml', __dir__)
    config_file = 'config/massa.yml'

    FileUtils.mkdir_p(File.dirname(config_file))
    FileUtils.cp(template, "#{Dir.pwd}/#{config_file}")
    Massa::CLI.colorize :default, 'File generated: ', :green, "#{config_file}\n"
    exit
  end

  opts.on('-h', '--help', 'Display this help') do
    puts opts
    puts
    puts 'You can read the official documentation here:'
    puts 'https://github.com/lucascaton/massa#massa'
    puts
    exit
  end

  opts.on('-v', '--version', 'Display version') do
    require 'massa/version'
    puts Massa::VERSION
    exit
  end

  opts.on('-V', '--verbose', 'Run verbosely') do |v|
    options[:verbose] = v
  end
end.parse!

begin
  Massa::Analyzier.run!(options)
rescue Gem::LoadError
  Massa::CLI.colorize :red, "¯\\_(ツ)_/¯ 'massa' gem is not in your Gemfile."
  exit 1
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
massa-0.6.0 bin/massa