<commit_before>require_relative 'deps/trollop'

require_relative 'pangrid/plugin'

module Pangrid
  def self.run_command_line
    # command line options
    opts = Trollop::options do
      opt :from, "Format to convert from", :type => :string
      opt :to, "Format to convert to", :type => :string
      opt :in, "Input file", :type => :string
      opt :out, "Output file", :type => :string
      opt :list, "List available format plugins"
    end

    run opts
  end

  def self.run(opts)<commit_msg>show help if all options are not specified<commit_after>require_relative 'deps/trollop'

require_relative 'pangrid/plugin'

module Pangrid
  def self.run_command_line
    # command line options
    p = Trollop::Parser.new do
      opt :from, "Format to convert from", :type => :string
      opt :to, "Format to convert to", :type => :string
      opt :in, "Input file", :type => :string
      opt :out, "Output file", :type => :string
      opt :list, "List available format plugins"
    end

    Trollop::with_standard_exception_handling p do
      opts = p.parse ARGV

      if opts[:list] || [:from, :to, :in, :out].all? {|k| opts[k]}
        run opts
      else
        p.educate
      end
    end
  end

  def self.run(opts)
{'fraction_non_alphanumeric': 0.1151662611516626, 'fraction_numerical': 0.0, 'mean_word_length': 2.9174603174603173, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '5725028', 'n_tokens_mistral': 403, 'n_tokens_neox': 394, 'n_words': 132}