<commit_before>module BBLib
  class OptsParser
    class Toggle < Option

      def extract(index, args)
        value = args[index]
        if value =~ /^\-[\w\d]$/ || flags.include?(value)
          args.delete_at(index)
        else
          flag = flags.find do |flag|
            next unless flag =~ /^\-[\w\d]$/
            value.include?(flag[1])
          end
          value.sub!(flag[1], '')
        end
        true
      end

      protected

      def simple_setup
        self.default = false
      end

    end
  end
end
<commit_msg>fixed bundled flag support.<commit_after>module BBLib
  class OptsParser
    class Toggle < Option

      def extract(index, args)
        value = args[index]
        if value =~ /^\-[\w\d]$/ || flags.include?(value)
          args.delete_at(index)
        elsif value =~ /^\-[\w\d]+$/
          flag = flags.find do |flag|
            next unless flag =~ /^\-[\w\d]$/
            value.include?(flag[1])
          end
          args[index] = value.sub(flag[1], '')
        end
        true
      end

      protected

      def simple_setup
        self.default = false
      end

    end
  end
end

{'fraction_non_alphanumeric': 0.12532637075718014, 'fraction_numerical': 0.0034812880765883376, 'mean_word_length': 1.4678111587982832, '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': '1983960', 'n_tokens_mistral': 362, 'n_tokens_neox': 355, 'n_words': 88}