Sha256: 5436e9109065f7732e0b577adcbd21ae21a9e12dc216959909378ea2e5aa5d74
Contents?: true
Size: 949 Bytes
Versions: 22
Compression:
Stored size: 949 Bytes
Contents
module Kontena::Cli::Master class UseCommand < Kontena::Command include Kontena::Cli::Common parameter "[NAME]", "Master name to use" option '--clear', :flag, "Clear current master setting" def execute if clear? config.current_master = nil config.write exit 0 elsif name.nil? signal_usage_error Clamp.message(:parameter_argument_error, :param => 'NAME', :message => "missing") exit 1 end master = config.find_server(name) if master.nil? exit_with_error p"Could not resolve master by name '#{name}'." + "\nFor a list of known masters please run: kontena master list" else config.current_master = master['name'] config.write puts "Using master: #{pastel.cyan(master['name'])} (#{master['url']})" puts "Using grid: #{current_grid ? pastel.cyan(current_grid) : "<none>"}" end end end end
Version data entries
22 entries across 22 versions & 1 rubygems