<commit_before>require "optparse"
require "grid_pattern_editor/window"

module GridPatternEditor
  class Command
    class << self
      def run(*arguments)
        options = parse_option(arguments)
        file_name = arguments[0]
        unless file_name
          $stderr.puts(<<-END_OF_MESSAGE)
Warning: not set an export/import file.
Usage: grid_pattern_editor [FILE_PATH]
          END_OF_MESSAGE
        end
        window = Window.new(file_name, options)
        window.show
      end

      def parse_option(arguments)
        options = {}

        parser = OptionParser.new

        parser.on("-w", "--width=WIDTH",
                  Integer) do |width|
          options[:width] = width
        end

        parser.on("-h", "--height=HEIGHT",
                  Integer) do |height|
          options[:height] = height
        end

        parser.on("--columns=NUMBER_OF_COLUMUNS",
                  Integer) do |columns|
          options[:columns] = columns
        end

        parser.on("--rows=NUMBER_OF_ROWS",
                  Integer) do |rows|
          options[:rows] = rows
        end

        parser.parse!(arguments)

        options
      end
    end
  end
end<commit_msg>Add descriptions to help message<commit_after>require "optparse"
require "grid_pattern_editor/window"

module GridPatternEditor
  class Command
    class << self
      def run(*arguments)
        options = parse_option(arguments)
        file_name = arguments[0]
        unless file_name
          $stderr.puts(<<-END_OF_MESSAGE)
Warning: not set an export/import file.
Usage: grid_pattern_editor [FILE_PATH]
          END_OF_MESSAGE
        end
        window = Window.new(file_name, options)
        window.show
      end

      def parse_option(arguments)
        options = {}

        parser = OptionParser.new

        parser.banner = "grid_pattern_editor [FILE_PATH] [OPTION]..."

        parser.on("-w", "--width=WIDTH",
                  Integer,
                  "Window width size (px)") do |width|
          options[:width] = width
        end

        parser.on("-h", "--height=HEIGHT",
                  Integer,
                  "Window height size (px)") do |height|
          options[:height] = height
        end

        parser.on("--columns=COLUMUNS",
                  Integer,
                  "Number of columns") do |columns|
          options[:columns] = columns
        end

        parser.on("--rows=ROWS",
                  Integer,
                  "Number of rows") do |rows|
          options[:rows] = rows
        end

        parser.parse!(arguments)

        options
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.09931506849315068, 'fraction_numerical': 0.00076103500761035, 'mean_word_length': 1.7131062951496387, 'pattern_counts': {'":': 0, '<': 11, '<?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': '1192381', 'n_tokens_mistral': 732, 'n_tokens_neox': 707, 'n_words': 173}