Sha256: 12e98ea446dead463c7c96f9b25dc7b566fb8f0f24f2e240391a04e8e7f2c0bb

Contents?: true

Size: 1.01 KB

Versions: 1

Compression:

Stored size: 1.01 KB

Contents

require 'thor'

module SearchKit
  class CLI < Thor
    include Messaging

    desc "documents", "Manage individual SearchKit documents"
    subcommand "documents", SearchKit::Documents::CLI

    desc "events", "Publish and subscribe to SearchKit events"
    subcommand "events", SearchKit::Events::CLI

    desc "indices", "Manage your SearchKit indices"
    subcommand "indices", SearchKit::Indices::CLI

    desc "search", "Quickly search your indices"
    subcommand "search", SearchKit::Search::CLI

    desc "config SETTING [VALUE]", "Configure or view your SearchKit settings"
    def config(setting, value = nil)
      if value
        SearchKit.set_config(setting, value)
        info "Set #{setting}: #{value}"
      else
        value = SearchKit.show_config(setting)
        info "SearchKit settings for #{setting}:"
        info " - ~/.search-kit/config.yml: #{value}"
        info " - ENV: #{ENV.fetch(setting.upcase, "Not set")}"
        info " - Runtime: #{SearchKit.config.send(setting)}"
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
search-kit-0.0.2 lib/search_kit/cli.rb