

___x_cmd_yml2json(){
    if [ -n "$___X_CMD_YML2JSON_COLOR" ]; then
        ___X_CMD_YML2JSON_ARG=-C
    fi

    case "$#" in
        0)  ___x_cmd_main yq ${___X_CMD_YML2JSON_ARG+"$___X_CMD_YML2JSON_ARG"} -o json e -P ;;
        1)  ___x_cmd_main yq ${___X_CMD_YML2JSON_ARG+"$___X_CMD_YML2JSON_ARG"} -o json e -P <"$1" ;;
        2)  ___x_cmd_main yq ${___X_CMD_YML2JSON_ARG+"$___X_CMD_YML2JSON_ARG"} -o json e -P <"$1" >"$2" ;;
        *)  x:error "Accept at most two arguments."; return 1 ;;
        # *)  ___x_cmd_main yq -o json e -P <"$1" >"$2" ;;
    esac

}
