Sha256: a3e8a83da2e247432305c64354509864521109a63c89af34d6fc7abcd2191ad8

Contents?: true

Size: 1.31 KB

Versions: 49

Compression:

Stored size: 1.31 KB

Contents

require "shopify_cli"

module ShopifyCLI
  module Commands
    Registry = CLI::Kit::CommandRegistry.new(
      default: "help",
      contextual_resolver: nil,
    )
    @core_commands = []

    def self.register(const, cmd, path = nil, is_core = false)
      autoload(const, path) if path
      Registry.add(->() { const_get(const) }, cmd)
      @core_commands.push(cmd) if is_core
    end

    def self.core_command?(cmd)
      @core_commands.include?(cmd)
    end

    register :Config, "config", "shopify_cli/commands/config", true
    register :Help, "help", "shopify_cli/commands/help", true
    register :Login, "login", "shopify_cli/commands/login", true
    register :Logout, "logout", "shopify_cli/commands/logout", true
    register :Populate, "populate", "shopify_cli/commands/populate", true
    register :Reporting, "reporting", "shopify_cli/commands/reporting", true
    register :Store, "store", "shopify_cli/commands/store", true
    register :Switch, "switch", "shopify_cli/commands/switch", true
    register :System, "system", "shopify_cli/commands/system", true
    register :Version, "version", "shopify_cli/commands/version", true
    register :Whoami, "whoami", "shopify_cli/commands/whoami", true
    register :App, "app", "shopify_cli/commands/app", true

    autoload :Connect, "shopify_cli/commands/connect"
  end
end

Version data entries

49 entries across 49 versions & 1 rubygems

Version Path
shopify-cli-2.36.0 lib/shopify_cli/commands.rb
shopify-cli-2.35.0 lib/shopify_cli/commands.rb
shopify-cli-2.34.0 lib/shopify_cli/commands.rb
shopify-cli-2.33.1 lib/shopify_cli/commands.rb
shopify-cli-2.33.0 lib/shopify_cli/commands.rb
shopify-cli-2.32.1 lib/shopify_cli/commands.rb
shopify-cli-2.32.0 lib/shopify_cli/commands.rb
shopify-cli-2.31.0 lib/shopify_cli/commands.rb
shopify-cli-2.30.0 lib/shopify_cli/commands.rb
shopify-cli-2.29.0 lib/shopify_cli/commands.rb
shopify-cli-2.28.0 lib/shopify_cli/commands.rb
shopify-cli-2.27.0 lib/shopify_cli/commands.rb
shopify-cli-2.26.0 lib/shopify_cli/commands.rb
shopify-cli-2.25.0 lib/shopify_cli/commands.rb
shopify-cli-2.24.0 lib/shopify_cli/commands.rb
shopify-cli-2.23.0 lib/shopify_cli/commands.rb
shopify-cli-2.22.0 lib/shopify_cli/commands.rb
shopify-cli-2.21.0 lib/shopify_cli/commands.rb
shopify-cli-2.20.1 lib/shopify_cli/commands.rb
shopify-cli-2.20.0 lib/shopify_cli/commands.rb