#!/usr/bin/ruby

require File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib', 'osrcry'))

arguments = ARGV.map {|arg| arg.downcase.split('.md', 2).first}
commands = %w{
  code_of_conduct
  contributing
  contributors
  init
  license
  stale
}

unless arguments.any? {|argument| commands.include?(argument)}
  puts "Please specify: `contributing`, `contributors`, `init`, `license` and/or `stale`"
else
  arguments.each do |command|
    case command
    when 'code_of_conduct'
      Osrcry::Contributing.execute
    when 'contributing'
      Osrcry::Contributing.execute
    when 'contributors'
      Osrcry::Contributors.execute
    when 'init'
      Osrcry::CodeOfConduct.execute
      Osrcry::Contributing.execute
      Osrcry::Contributors.execute
      Osrcry::License.execute
    when 'license'
      Osrcry::License.execute
    when 'stale'
      Osrcry::Stale.execute
    end
  end
end