Sha256: 3e3877a35162d40312834d91027371713038c4cb7399e04644cc18c326387cc7

Contents?: true

Size: 1.27 KB

Versions: 25

Compression:

Stored size: 1.27 KB

Contents

# frozen_string_literal: true

require_relative "new_command"
require_relative "version_command"

module Superbot
  module CLI
    class RootCommand < Clamp::Command
      banner "superbot 🤖"

      option ['-v', '--version'], :flag, "Show version information" do
        puts Superbot::VERSION
        exit(0)
      end

      subcommand ["version"], "Show version information", VersionCommand
      subcommand ["new"], "Create a new project", NewCommand if ENV['SUPERBOT_FEAT_PROJECT'] == 'true'

      if defined?(Superbot::Record::CLI::RootCommand)
        subcommand ["record"], "Superbot recorder tools", ::Superbot::Record::CLI::RootCommand
      end

      if defined?(::Superbot::Runner::CLI::RootCommand)
        subcommand ["run"], "Run superbot scripts", ::Superbot::Runner::CLI::RootCommand
      end

      if defined?(::Superbot::Cloud::CLI::RootCommand)
        subcommand ["cloud"], "Show cloud commands", ::Superbot::Cloud::CLI::RootCommand
      end

      if defined?(::Superbot::Teleport::CLI::RootCommand)
        subcommand ["teleport"], "Open teleport to the cloud", ::Superbot::Teleport::CLI::RootCommand
      end

      def self.run
        super
      rescue StandardError => exc
        warn exc.message
        warn exc.backtrace.join("\n")
      end
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
superbot-0.5.3 lib/superbot/cli/root_command.rb
superbot-0.5.2 lib/superbot/cli/root_command.rb
superbot-0.5.1 lib/superbot/cli/root_command.rb
superbot-0.5.0 lib/superbot/cli/root_command.rb
superbot-0.4.9 lib/superbot/cli/root_command.rb
superbot-0.4.8 lib/superbot/cli/root_command.rb
superbot-0.4.7 lib/superbot/cli/root_command.rb
superbot-0.4.6 lib/superbot/cli/root_command.rb
superbot-0.4.5 lib/superbot/cli/root_command.rb
superbot-0.4.4 lib/superbot/cli/root_command.rb
superbot-0.4.3 lib/superbot/cli/root_command.rb
superbot-0.4.2 lib/superbot/cli/root_command.rb
superbot-0.4.1 lib/superbot/cli/root_command.rb
superbot-0.4.0 lib/superbot/cli/root_command.rb
superbot-0.3.7 lib/superbot/cli/root_command.rb
superbot-0.3.6 lib/superbot/cli/root_command.rb
superbot-0.3.5 lib/superbot/cli/root_command.rb
superbot-0.3.4 lib/superbot/cli/root_command.rb
superbot-0.3.3 lib/superbot/cli/root_command.rb
superbot-0.3.2 lib/superbot/cli/root_command.rb