# encoding: UTF-8 # frozen_string_literal: true require 'nrser/refinements/types' using NRSER::Types # Namespace # ======================================================================= module Locd module CLI module Command # Definitions # ======================================================================= class Agent < Base desc "update PATTERN [OPTIONS] [-- CMD_TEMPLATE...]", "Update an existing agent" include_shared t[ groups: t.has_any( :write, :add, :respond_with_agents ) ] def update *cmd_template agent = find_only! pattern new_agent = agent.update \ cmd_template: cmd_template, **option_kwds( groups: :write ) logger.info "Agent `#{ agent.label }` updated" respond agent end end # /Namespace # ======================================================================= end # module Command end # module CLI end # module Locd