Sha256: 58a35de3b232d6d25472a019bcb7d0fe965a0b229553256154f61ec0a7b84c8b
Contents?: true
Size: 675 Bytes
Versions: 51
Compression:
Stored size: 675 Bytes
Contents
require_relative '../common' module Kontena::Cli::Stacks::Registry class SearchCommand < Kontena::Command include Kontena::Cli::Common include Kontena::Cli::Stacks::Common banner "Search for stacks on the stack registry" parameter "[QUERY]", "Query string" def execute results = stacks_client.search(query.to_s) exit_with_error 'Nothing found' if results.empty? titles = ['NAME', 'VERSION', 'DESCRIPTION'] columns = "%-40s %-10s %-40s" puts columns % titles results.each do |stack| puts columns % [stack['stack'], stack['version'] || '?', stack['description'] || '-'] if stack end end end end
Version data entries
51 entries across 51 versions & 1 rubygems