#!/usr/bin/env ruby

require "pathname"
require "yaml"

# A simple CLI to get values in .eil.yml

key = ARGV.shift
project_root = Pathname.new(File.expand_path(__FILE__)).parent.parent
eil_file = project_root / ".eil.yml"
doc = YAML.safe_load(File.read eil_file)

case key
when "copyright_string"
  puts doc["copyrights"].map { |e| "#{e['year']}, #{e['name']}" }.join(", ")
else
  puts doc[key]
end
