Sha256: aff39a1c1aae3ed94377ff1a7b2ff488e830c3293ab062f736244be695dd716b

Contents?: true

Size: 918 Bytes

Versions: 3

Compression:

Stored size: 918 Bytes

Contents

#!/usr/bin/env ruby
require 'clausewitz/spelling/checker'
require 'optimist'

class Main
  def initialize(args)
    @opts, @args = parse_args(args)
  end

  def parse_args(args)
    opts = Optimist::options(args) do
      opt :custom_wordlist,
        "Text file containing newline-delimited list of custom words",
        type: :string
      opt :english_dialect,
        "Two-letter code indicating dialect of English to use",
        type: :string
      opt :spanish_dialect,
        "Two-letter code indicating dialect of Spanish to use",
        type: :string
      opt :suggestion_count,
        "How many suggestions to display",
        type: :int
    end
    [opts, args]
  end

  def run
    spellchecker = Clausewitz::Spelling::Checker.new(@opts)
    results = spellchecker.check_files(@args)
    results.render
    !results.failed?
  end
end

exit(Main.new(ARGV).run)

# vim: set ft=ruby ts=2 sw=2 tw=79 :

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
clausewitz-spelling-0.1.9 exe/clausewitz-spellcheck
clausewitz-spelling-0.1.8 exe/clausewitz-spellcheck
clausewitz-spelling-0.1.7 exe/clausewitz-spellcheck