Sha256: bc37ad9439bb4182c513bc23f3365b02c1c0674dba22341fae2aa1cdcc75a374

Contents?: true

Size: 587 Bytes

Versions: 153

Compression:

Stored size: 587 Bytes

Contents

require_relative 'common'

module Kontena::Cli::Grids
  class CurrentCommand < Kontena::Command
    include Kontena::Cli::Common
    include Common

    option ["--name"], :flag, "Show name only", default: false

    def execute
      require_api_url
      if current_grid.nil?
        exit_with_error 'No grid selected. To select grid, please run: kontena grid use <grid name>'
      else

        grid = client(require_token).get("grids/#{current_grid}")
        if name?
          puts "#{grid['name']}"
        else
          print_grid(grid)
        end
      end
    end
  end
end

Version data entries

153 entries across 153 versions & 2 rubygems

Version Path
kontena-cli-1.4.0.pre1 lib/kontena/cli/grids/current_command.rb
kontena-cli-1.3.4 lib/kontena/cli/grids/current_command.rb
kontena-cli-1.3.4.rc1 lib/kontena/cli/grids/current_command.rb
kontena-cli-1.3.3 lib/kontena/cli/grids/current_command.rb
kontena-cli-1.3.3.rc1 lib/kontena/cli/grids/current_command.rb
kontena-cli-1.3.2 lib/kontena/cli/grids/current_command.rb
kontena-cli-1.3.2.rc2 lib/kontena/cli/grids/current_command.rb
kontena-cli-1.3.2.rc1 lib/kontena/cli/grids/current_command.rb
kontena-cli-1.3.1 lib/kontena/cli/grids/current_command.rb
kontena-cli-1.3.1.rc2 lib/kontena/cli/grids/current_command.rb
kontena-cli-1.3.1.rc1 lib/kontena/cli/grids/current_command.rb
kontena-cli-1.3.0 lib/kontena/cli/grids/current_command.rb
kontena-cli-1.3.0.rc4 lib/kontena/cli/grids/current_command.rb
kontena-cli-1.3.0.rc3 lib/kontena/cli/grids/current_command.rb
kontena-cli-1.3.0.rc2 lib/kontena/cli/grids/current_command.rb
kontena-cli-1.3.0.rc1 lib/kontena/cli/grids/current_command.rb
kontena-cli-1.3.0.pre2 lib/kontena/cli/grids/current_command.rb
kontena-cli-1.3.0.pre1 lib/kontena/cli/grids/current_command.rb
kontena-cli-1.2.2 lib/kontena/cli/grids/current_command.rb
kontena-cli-1.2.2.rc2 lib/kontena/cli/grids/current_command.rb