# shellcheck shell=dash

___x_cmd_agent_job_stop(){
    local jobid=""

    while [ $# -gt 0 ]; do
        case "$1" in
            -h|--help)      ___x_cmd help -m agent job stop; return 0 ;;
            --job-id)       jobid="$2" ; arg:2:shift ;;
            *)              break ;;
        esac
    done

    [ -n "$jobid" ] || N=agent M="Please specify the job id to stop." log:ret:64

    agent:info "Stopping agent job id[$jobid]"

    ___x_cmd worker stop --ns 'x-agent-job' --name "$jobid"
}
