<commit_before>module Percheron
  module CLI
    class AbstractCommand < Clamp::Command

      option [ '-c', '--config_file' ], 'CONFIG', 'Configuration file', default: '.percheron.yml'

      option '--version', :flag, 'show version' do
        puts Percheron::VERSION
        exit(0)
      end

      def config
        @config ||= Percheron::Config.new(config_file)
      rescue Errors::ConfigFileInvalid => e
        $logger.error e.message
        exit(1)<commit_msg>Allow config file to be specified in PERCHERON_CONFIG env var<commit_after>module Percheron
  module CLI
    class AbstractCommand < Clamp::Command

      DEFAULT_CONFIG_FILE = '.percheron.yml'

      option [ '-c', '--config_file' ], 'CONFIG', 'Configuration file', default: DEFAULT_CONFIG_FILE

      option '--version', :flag, 'show version' do
        puts Percheron::VERSION
        exit(0)
      end

      def default_config_file
        ENV.fetch('PERCHERON_CONFIG', DEFAULT_CONFIG_FILE)
      end

      def config
        @config ||= Percheron::Config.new(config_file)
      rescue Errors::ConfigFileInvalid => e
        $logger.error e.message
        exit(1)
{'fraction_non_alphanumeric': 0.10936132983377078, 'fraction_numerical': 0.003499562554680665, 'mean_word_length': 2.7755775577557755, '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': '233541', 'n_tokens_mistral': 343, 'n_tokens_neox': 338, 'n_words': 85}