Sha256: b49bb5352ce3830faf3d9c619d75233427e6303d7ecafa3cbb5e277d46d1015e

Contents?: true

Size: 613 Bytes

Versions: 1

Compression:

Stored size: 613 Bytes

Contents

require "optparse"
require "sakuru/version"

module Sakuru
  class Command
    def self.run(arguments)
      new(arguments).run
    end

    def initialize(arguments)
      @options = parse_options(arguments)
    end

    def run
    end

    private
    def parse_options(arguments)
      options = {}

      parser = OptionParser.new(<<-USAGE)
Usage:
  require "sakuru"

  db = Sakuru::Database.new
  db.add(file_path)
  db.add(uri)
  db.search(query)
  db.save(output_path)
  db.load(saved_file_path)
      USAGE

      parser.version = VERSION

      parser.parse!(arguments)

      options
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
sakuru-0.0.1 lib/sakuru/command.rb