Sha256: 42a5715a4eb17627f0a033bdb501a9c8f3b9cf67c4a5b25615ad51ee123257e1

Contents?: true

Size: 1.23 KB

Versions: 6

Compression:

Stored size: 1.23 KB

Contents

require "magellan/cli"

require 'thor'
require 'active_support/core_ext/string/inflections'

module Magellan
  module Cli
    class Command < Base
      {
        "organization"  => "Organization",
        "team"          => "Team",
        "project"       => "Project",
        "stage"         => "Stage",
        "client_version" => "ClientVersion",
        #"tr"            => "TransactionRouter",
        "worker"        => "Worker",
        "image"         => "Image",
        "container"     => "Container",
        "cloudsql"      => "Cloudsql",
      }.each do |name, classname|
        desc "#{name} SUBCOMMAND ...ARGS", "manage #{name}"
        subcommand name, ::Magellan::Cli::Resources.const_get(classname)
      end

      #desc "direct SUBCOMMAND ...ARGS", "send request directly"
      #subcommand "direct", ::Magellan::Cli::Direct

      desc "login", "login to a Magellan API server"
      def login
        print "email: "
        email = STDIN.gets.chomp
        print "password: "
        password = STDIN.noecho(&:gets).chomp
        puts ""

        Magellan::Cli::Http.new.login!(email, password)
      end

      desc "version", "show version"
      def version
        $stdout.puts Magellan::Cli::VERSION
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
magellan-cli-0.2.17 lib/magellan/cli/command.rb
magellan-cli-0.2.16 lib/magellan/cli/command.rb
magellan-cli-0.2.15 lib/magellan/cli/command.rb
magellan-cli-0.2.14 lib/magellan/cli/command.rb
magellan-cli-0.2.13 lib/magellan/cli/command.rb
magellan-cli-0.2.12 lib/magellan/cli/command.rb