<commit_before>require 'optparse'
require 'ostruct'

module Tinfoil
  class CLI
    DEFAULT_OUTPUT_FILE = 'results.txt'

    def self.run (args)
      options = default_options
      parse(args, options)

      if options.filename.nil? and options.file.nil?
        puts "Nothing to do. Rerun with --help for more information."
        exit 1
      end
    end

    class << self
      private

      def parse (args, options)
        optparse = OptionParser.new do |opts|
          opts.on('-h', '--help', 'Display this screen') do
            puts usage
            puts opts
            exit 1
          end

          opts.on('-f', '--file FILE', 'Perform a scan with the given configuration file') do |file|
            options.file = file
          end

          opts.on('-o', '--output [FILENAME]', "Store output in a file.  Default: #{DEFAULT_OUTPUT_FILE}") do |output_file|
            options.output_file = output_file || DEFAULT_OUTPUT_FILE
          end

          opts.on('-s', '--server SERVER', 'Scan a single server') do |server|
            options.server = server
          end

          opts.on('-t', '--timeout [SECONDS]', Integer, "Change the timeout value.  Default: #{options.timeout} seconds.") do |timeout|
            options.timeout = timeout
          end<commit_msg>Fixing wrong variable name in the struct.<commit_after>require 'optparse'
require 'ostruct'

module Tinfoil
  class CLI
    DEFAULT_OUTPUT_FILE = 'results.txt'

    def self.run (args)
      options = default_options
      parse(args, options)

      if options.server.nil? and options.file.nil?
        puts "Nothing to do. Rerun with --help for more information."
        exit 1
      end
    end

    class << self
      private

      def parse (args, options)
        optparse = OptionParser.new do |opts|
          opts.on('-h', '--help', 'Display this screen') do
            puts usage
            puts opts
            exit 1
          end

          opts.on('-f', '--file FILE', 'Perform a scan with the given configuration file') do |file|
            options.file = file
          end

          opts.on('-o', '--output [FILENAME]', "Store output in a file.  Default: #{DEFAULT_OUTPUT_FILE}") do |output_file|
            options.output_file = output_file || DEFAULT_OUTPUT_FILE
          end

          opts.on('-s', '--server SERVER', 'Scan a single server') do |server|
            options.server = server
          end

          opts.on('-t', '--timeout [SECONDS]', Integer, "Change the timeout value.  Default: #{options.timeout} seconds.") do |timeout|
            options.timeout = timeout
          end
{'fraction_non_alphanumeric': 0.11030534351145038, 'fraction_numerical': 0.0015267175572519084, 'mean_word_length': 1.9582392776523703, 'pattern_counts': {'":': 0, '<': 7, '<?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': '2084677', 'n_tokens_mistral': 748, 'n_tokens_neox': 731, 'n_words': 243}