<commit_before>module Ru
  class Process
    def initialize(options={})
      @command = options[:command]
      @args = options[:args]
      @stdin = options[:stdin]
      if @command.kind_of?(String) && @command.start_with?('[')
        @command = 'to_stdout' + @command
      end
      @options = Options.new
    end

    def run
      if @options.exists?(@command)
        return @options.run(@command)
      end
      paths = @args
      if @stdin.blank? && paths.present?
        @stdin = paths.map { |path| ::File.open(path).read }.join("\n")<commit_msg>If no arguments are given, print help to STDERR and exit 1<commit_after>module Ru
  class Process
    def initialize(options={})
      @command = options[:command]
      @args = options[:args]
      @stdin = options[:stdin]
      if @command.kind_of?(String) && @command.start_with?('[')
        @command = 'to_stdout' + @command
      end
      @options = Options.new
    end

    def run
      if @command.nil?
        STDERR.puts @options.run('--help')
        exit 1
      end
      if @options.exists?(@command)
        return @options.run(@command)
      end
      paths = @args
      if @stdin.blank? && paths.present?
        @stdin = paths.map { |path| ::File.open(path).read }.join("\n")
{'fraction_non_alphanumeric': 0.14705882352941177, 'fraction_numerical': 0.001589825119236884, 'mean_word_length': 2.3844086021505375, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '1729465', 'n_tokens_mistral': 402, 'n_tokens_neox': 398, 'n_words': 95}