Sha256: f5c81363c54288bca3e6db6cec0badcce25958fee66ca9347a48f30f7aa3daab
Contents?: true
Size: 619 Bytes
Versions: 158
Compression:
Stored size: 619 Bytes
Contents
require 'uri' module Kontena::Cli::Master class CurrentCommand < Kontena::Command include Kontena::Cli::Common option ["--name"], :flag, "Show name only", default: false option ["--address"], :flag, "Show IP address or FQDN only", default: false option ["--url"], :flag, "Show URL only", default: false def execute master = require_current_master if name? puts master['name'] elsif address? puts URI.parse(master['url']).host elsif url? puts master['url'] else puts "#{master['name']} #{master['url']}" end end end end
Version data entries
158 entries across 158 versions & 2 rubygems