# 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