<commit_before>require 'thor'
require 'electric_sheep'

module ElectricSheep
  class CLI < Thor
    
    desc "work", "Start processing projects."
    option :config, aliases: %w(-c), type: :string,
      desc: 'Configuration file containing projects', default: 'Sheepfile'
    option :project, aliases: %w(-p), type: :string,
      desc: 'Name of a single project to execute'
    def work
      begin
        Runner.new(
          config: configuration,
          project: options[:project],
          logger: Log::ConsoleLogger.new(STDOUT, STDERR)
        ).run!
      rescue => ex
        raise Thor::Error, ex
      end
    end

    option :key, aliases: %w(-k), required: true
    desc "encrypt SECRET", "Encrypt SECRET using the provided public key"
    def encrypt(secret)
      puts Crypto.encrypt(secret, options[:key])
    end

    protected
    def configuration
      Sheepfile::Evaluator.new(options[:config]).evaluate
    end<commit_msg>(Temporarily) make the CLI output the backtrace<commit_after>require 'thor'
require 'electric_sheep'

module ElectricSheep
  class CLI < Thor
    
    desc "work", "Start processing projects."
    option :config, aliases: %w(-c), type: :string,
      desc: 'Configuration file containing projects', default: 'Sheepfile'
    option :project, aliases: %w(-p), type: :string,
      desc: 'Name of a single project to execute'
    def work
      begin
        Runner.new(
          config: configuration,
          project: options[:project],
          logger: Log::ConsoleLogger.new(STDOUT, STDERR)
        ).run!
      rescue => ex
        raise Thor::Error, ex.message + "\n" + ex.backtrace.join("\n")
      end
    end

    option :key, aliases: %w(-k), required: true
    desc "encrypt SECRET", "Encrypt SECRET using the provided public key"
    def encrypt(secret)
      puts Crypto.encrypt(secret, options[:key])
    end

    protected
    def configuration
      Sheepfile::Evaluator.new(options[:config]).evaluate
    end
{'fraction_non_alphanumeric': 0.11077389984825493, 'fraction_numerical': 0.0, 'mean_word_length': 2.8038461538461537, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1846804', 'n_tokens_mistral': 592, 'n_tokens_neox': 576, 'n_words': 181}