# shellcheck shell=dash
___x_cmd_log_exec_log(){
    local IFS=" "
    ___x_cmd log ":${N:-x}" "${L:-info}" "Exec:" "$@"
}

___x_cmd_log_exec(){
    ___x_cmd_log_exec_log "$@"
    "$@"
}

___x_cmd_log_exec___todo(){
    local O
    local MSG
    while [ $# -gt 0 ]; do
        case "$1" in
            :*)     O="${1#:}";         shift ;;
            -m)     arg:2:nonempty
                    MSG="${2}";         shift 2 ;;
            --)     break;              shift ;;
            *)      break ;;
        esac
    done

    log:sub:init ":${O:-x}" "$MSG" # TODO: Running command as the detail.

    local indent="${___X_CMD_LOG_YML_INDENT}  "
    if [ -z "$x_LOG_FLAT" ]; then
        # Pack flow.
        ___x_cmd outerr pack \
            --stdout-prefix "${indent}" \
            --stderr-prefix "${indent}# " \
            "$@"
    else
        ___x_cmd outerr pack \
            --stdout-prefix "${indent} -" \
            --stderr-prefix "${indent}# " \
            "$@"
    fi
}

