Sha256: 8387c82fd9120c849321a38210a28276537907564941bc43002ca43fa2b95753

Contents?: true

Size: 720 Bytes

Versions: 8

Compression:

Stored size: 720 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 :dictionary_root,
        "Directory containing per-language custom word lists",
        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 = @args.map { |arg| spellchecker.check_file(arg) }
    results.each { |r| puts r }
    !results.any?(&:failed?)
  end
end

exit(Main.new(ARGV).run)

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

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
clausewitz-spelling-0.1.17 exe/clausewitz-spellcheck
clausewitz-spelling-0.1.16 exe/clausewitz-spellcheck
clausewitz-spelling-0.1.15 exe/clausewitz-spellcheck
clausewitz-spelling-0.1.14 exe/clausewitz-spellcheck
clausewitz-spelling-0.1.13 exe/clausewitz-spellcheck
clausewitz-spelling-0.1.12 exe/clausewitz-spellcheck
clausewitz-spelling-0.1.11 exe/clausewitz-spellcheck
clausewitz-spelling-0.1.10 exe/clausewitz-spellcheck