Sha256: daa476c120b27ed0a8d1518c36ba9fa158d0b544693f56c35c6e2de1c21b8be1

Contents?: true

Size: 1.07 KB

Versions: 1

Compression:

Stored size: 1.07 KB

Contents

# encoding: UTF-8
# frozen_string_literal: true


# Refinements
# =======================================================================

require 'nrser/refinements/types'
using NRSER::Types


# Namespace
# =======================================================================

module  Locd
module  CLI
module  Command


# Definitions
# =======================================================================

class Agent < Base
  
  desc              "ls",
                    "List agents"
  
  map               list: :ls
  
  include_shared    t[ name: :pattern, kind: :argument ],
    required:       false,
    default:        nil

  include_shared    t[ groups: :pattern, kind: :option ]
  
  include_shared    t[ groups: :respond_with_agents ]
  
  def ls
    results = if pattern.nil?
      agent_class.all
    else
      agent_class.list pattern, **option_kwds( groups: :pattern )
    end
    
    respond results.values.sort
  end

end


# /Namespace
# =======================================================================

end # module  Command
end # module  CLI
end # module  Locd

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
locd-0.1.13 lib/locd/cli/command/agent/ls.rb