<commit_before>
module Raph
  class ArgList
    attr_reader :args

    def initialize(args)
      @args = args
    end
  end
end<commit_msg>Flag detection<commit_after>module Raph
  class ArgList
    attr_reader :all, :files, :flags

    def initialize(args)
      @args = args
    end

    private

    def parse
      @args.each do

      end
    end

    # Considers option as flag if an only if
    # it's name starts with one dash and follows by
    # one word character or starts with two dashes
    # and follows by 2 or more word chacters or dashes.
    #
    # Assumes that option doesn't have spaces.
    #
    # Example of flags:
    #   '-h' '-text' '--config'
    #
    # Example of non-flags:
    #   'option' '---option2' '--h'
    def flag?(option)
      option =~ /^-[\w]$/ or option =~ /^--[\w-]{2,}$/
    end
  end
end

raph = Raph::ArgList.new(ARGV)
p ARGV
puts "All args: #{raph.all}"
puts "Files   : #{raph.files}"
puts "Flags   : #{raph.flags}"
{'fraction_non_alphanumeric': 0.12099276111685625, 'fraction_numerical': 0.0031023784901758012, 'mean_word_length': 2.205298013245033, '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': '6396878', 'n_tokens_mistral': 338, 'n_tokens_neox': 327, 'n_words': 111}