<commit_before>module Mercenary
  class Program < Command
    attr_reader :optparse
    attr_reader :config

    # Public: Creates a new Program
    #
    # name - the name of the program
    #
    # Returns nothing
    def initialize(name)
      @config = {}
      super(name)
    end

    # Public: Sets or gets the program version
    #
    # version - the program version (optional)
    #
    # Returns the version and sets it if an argument is present
    def version(version = nil)
      @version = version if version
      @version
    end

    # Public: Run the program
    #
    # argv   - an array of string args (usually ARGV)
    #
    # Returns nothing
    def go(argv)
      logger.debug("Using args passed in: #{argv.inspect}")

      cmd = nil

      @optparse = OptionParser.new do |opts|
        cmd = super(argv, opts, @config)

        opts.on('-v' '--version', 'Print the version') do
          puts "#{name} #{version}"
          abort
        end
      end

      @optparse.parse!(argv)

      logger.debug("Parsed config: #{@config.inspect}")

      cmd.execute(argv, @config)
    end
  end
end<commit_msg>Added missing comma to fix '-v' and '--version' options<commit_after>module Mercenary
  class Program < Command
    attr_reader :optparse
    attr_reader :config

    # Public: Creates a new Program
    #
    # name - the name of the program
    #
    # Returns nothing
    def initialize(name)
      @config = {}
      super(name)
    end

    # Public: Sets or gets the program version
    #
    # version - the program version (optional)
    #
    # Returns the version and sets it if an argument is present
    def version(version = nil)
      @version = version if version
      @version
    end

    # Public: Run the program
    #
    # argv   - an array of string args (usually ARGV)
    #
    # Returns nothing
    def go(argv)
      logger.debug("Using args passed in: #{argv.inspect}")

      cmd = nil

      @optparse = OptionParser.new do |opts|
        cmd = super(argv, opts, @config)

        opts.on('-v', '--version', 'Print the version') do
          puts "#{name} #{version}"
          abort
        end
      end

      @optparse.parse!(argv)

      logger.debug("Parsed config: #{@config.inspect}")

      cmd.execute(argv, @config)
    end
  end
end
{'fraction_non_alphanumeric': 0.09986973512809379, 'fraction_numerical': 0.0, 'mean_word_length': 2.0884718498659516, 'pattern_counts': {'":': 0, '<': 5, '<?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': '1171686', 'n_tokens_mistral': 689, 'n_tokens_neox': 671, 'n_words': 229}