Sha256: 564167e96c674c8812abbdd59976376e039de6eaa6f3dc3048968835c6708657

Contents?: true

Size: 752 Bytes

Versions: 54

Compression:

Stored size: 752 Bytes

Contents

require_relative 'common'

module Kontena::Cli::Plugins
  class SearchCommand < Kontena::Command
    include Common

    parameter '[NAME]', 'Search text'
    option '--pre', :flag, 'Include pre-release versions'

    def execute
      results = Kontena::PluginManager.instance.search_plugins(name)
      exit_with_error("Cannot access plugin server") unless results
      puts "%-50s %-10s %-60s" % ['NAME', 'VERSION', 'DESCRIPTION']
      results.each do |item|
        if pre?
          latest = Kontena::PluginManager.instance.latest_version(item['name'], pre: true)
          item['version'] = latest.version.to_s
        end
        puts "%-50s %-10s %-60s" % [short_name(item['name']), item['version'], item['info']]
      end
    end
  end
end

Version data entries

54 entries across 54 versions & 1 rubygems

Version Path
kontena-cli-1.3.5 lib/kontena/cli/plugins/search_command.rb
kontena-cli-1.3.5.rc1 lib/kontena/cli/plugins/search_command.rb
kontena-cli-1.4.0.pre6 lib/kontena/cli/plugins/search_command.rb
kontena-cli-1.4.0.pre5 lib/kontena/cli/plugins/search_command.rb
kontena-cli-1.4.0.pre4 lib/kontena/cli/plugins/search_command.rb
kontena-cli-1.4.0.pre3 lib/kontena/cli/plugins/search_command.rb
kontena-cli-1.4.0.pre2 lib/kontena/cli/plugins/search_command.rb
kontena-cli-1.4.0.pre1 lib/kontena/cli/plugins/search_command.rb
kontena-cli-1.3.4 lib/kontena/cli/plugins/search_command.rb
kontena-cli-1.3.4.rc1 lib/kontena/cli/plugins/search_command.rb
kontena-cli-1.3.3 lib/kontena/cli/plugins/search_command.rb
kontena-cli-1.3.3.rc1 lib/kontena/cli/plugins/search_command.rb
kontena-cli-1.3.2 lib/kontena/cli/plugins/search_command.rb
kontena-cli-1.3.2.rc2 lib/kontena/cli/plugins/search_command.rb
kontena-cli-1.3.2.rc1 lib/kontena/cli/plugins/search_command.rb
kontena-cli-1.3.1 lib/kontena/cli/plugins/search_command.rb
kontena-cli-1.3.1.rc2 lib/kontena/cli/plugins/search_command.rb
kontena-cli-1.3.1.rc1 lib/kontena/cli/plugins/search_command.rb
kontena-cli-1.3.0 lib/kontena/cli/plugins/search_command.rb
kontena-cli-1.3.0.rc4 lib/kontena/cli/plugins/search_command.rb