# shellcheck shell=dash

___x_cmd_score_compute(){
    [ $# -gt 0 ]    ||  set -- --help

    local yml_file="" tsv_file=""

    while [ $# -gt 0 ]; do
        case "$1" in
            -h|--help)  ___x_cmd help -m score compute "$@"; return 0 ;;
            --)         shift ; break ;;
            *)          [ -z "$yml_file" ] && yml_file="$1" || tsv_file="$1" ; shift ;;
        esac
    done

    [ -n "$yml_file" ] || { N=score M="Usage: x score compute <score.yml> <score.tsv>" log:ret:64; }
    [ -f "$yml_file" ] || { N=score M="File not found: $yml_file" log:ret:64; }
    [ -n "$tsv_file" ] || { N=score M="Usage: x score compute <score.yml> <score.tsv>" log:ret:64; }
    [ -f "$tsv_file" ] || { N=score M="File not found: $tsv_file" log:ret:64; }

    local skill_dir=""
    ___x_cmd_score_skill_dir_ || { N=score M="Unable to locate skill0/score/" log:ret:64; }
    skill_dir="$x_"

    python3 "$skill_dir/compute.py" "$yml_file" "$tsv_file"
}
