<commit_before>require 'optparse'

module Valr
  class OptParser
    def self.parse(args)
      options = {}
      options[:range] = nil
      options[:first_parent] = false

      opt_parser = OptionParser.new do |opts|
        opts.banner = "Usage: valr [options] [repository]"

        opts.separator ''
        opts.separator 'Range options:'

        opts.on('-r', '--range [RANGE]', 'display commits only for the RANGE') do |range|
          options[:range] = range
        end

        opts.on('-f', '--from [REV]', 'display commits from REV to HEAD') do |rev|
          options[:range] = "#{rev}..HEAD"
        end

        opts.separator ''
        opts.separator 'Filter:'

        opts.on('-p', '--first-parent', 'display only first-parent commits') do |p|
          options[:first_parent] = p
        end

        opts.separator ''
        opts.separator 'Help:'
        opts.on_tail("-h", "--help", "Show this message") do
          puts opts
          exit<commit_msg>[#13] Add option to specify the branch<commit_after>require 'optparse'

module Valr
  class OptParser
    def self.parse(args)
      options = {}
      options[:range] = nil
      options[:first_parent] = false

      opt_parser = OptionParser.new do |opts|
        opts.banner = "Usage: valr [options] [repository]"

        opts.separator ''
        opts.separator 'Range options:'

        opts.on('-r', '--range [RANGE]', 'display commits only for the RANGE') do |range|
          options[:range] = range
        end

        opts.on('-f', '--from [REV]', 'display commits from REV to HEAD') do |rev|
          options[:range] = "#{rev}..HEAD"
        end

        opts.separator ''
        opts.separator 'Branch options:'

        opts.on('-b', '--branch [BRANCH]', 'display commits for a specific BRANCH') do |branch|
          options[:branch] = branch
        end

        opts.separator ''
        opts.separator 'Filter:'

        opts.on('-p', '--first-parent', 'display only first-parent commits') do |p|
          options[:first_parent] = p
        end

        opts.separator ''
        opts.separator 'Help:'
        opts.on_tail("-h", "--help", "Show this message") do
          puts opts
          exit
{'fraction_non_alphanumeric': 0.14168937329700274, 'fraction_numerical': 0.0009082652134423251, 'mean_word_length': 2.0725244072524407, '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': '4402837', 'n_tokens_mistral': 678, 'n_tokens_neox': 639, 'n_words': 183}