Sha256: 537b14043a9f166ada56f9f6e4261b3f0bb3edd6baecf7961814f6f59bf313c0
Contents?: true
Size: 595 Bytes
Versions: 24
Compression:
Stored size: 595 Bytes
Contents
module Kontena::Cli::Master class ListCommand < Kontena::Command include Kontena::Cli::Common include Kontena::Cli::TableGenerator::Helper def fields @fields ||= quiet? ? %w(name) : %w(name url) end def current_master_name @current_master_name ||= current_master.nil? ? nil : current_master.name end def mark_if_current(row) unless quiet? row.name.insert(0, pastel.yellow('* ')) if row.name == current_master_name end end def execute print_table(config.servers, fields, &method(:mark_if_current)) end end end
Version data entries
24 entries across 24 versions & 1 rubygems