Sha256: 9b83738164f55d5af196f6561eb337d262fb1454b5bc62fc966477dfb2ef8c32

Contents?: true

Size: 1003 Bytes

Versions: 1

Compression:

Stored size: 1003 Bytes

Contents

#!/usr/bin/env ruby

# frozen_string_literal: true

require "how_is"
require "how_is/cli"
require "how_is/config"
require "how_is/text"

begin
  cli = HowIs::CLI.parse(ARGV)
rescue OptionParser::ParseError => e
  abort "how_is: error: #{e.message}"
end

options = cli.options

abort cli.help_text         if options[:help]
abort HowIs::VERSION_STRING if options[:version]

date = options[:date]

begin
  config = HowIs::Config.new

  config.load_defaults unless options[:no_user_config]
  config.load_env if options[:env_config]

  if options[:config]
    config.load_files(options[:config])
  else
    config.load(HowIs.default_config(options[:repository]))
  end

  reports = HowIs.from_config(config, date)

  files = reports.save_all
  HowIs::Text.puts "Saved reports to:"
  files.each { |file| HowIs::Text.puts "- #{file}" }
rescue => e
  raise if options[:verbose]

  warn "how_is: error: #{e.message} (Pass --verbose for more details.)"
  warn "  at: #{e.backtrace_locations.first}"
  exit 1
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
how_is-25.0.0 exe/how_is