
___x_cmd_facl_get___darwin(){
    local mode=foreach
    local skip=1
    while [ $# -gt 0 ]; do
        case "$1" in
            -|--pipe)       mode=pipe;  shift ;;
            -a|--all)       skip=0;     shift ;;
            *)              break ;;
        esac
    done

    if ___x_cmd_is_stdout2tty; then
        ___x_cmd_facl_get___darwin___"$mode" "$@" | ___x_cmd_facl_get___darwin_one_visualize
    else
        ___x_cmd_facl_get___darwin___"$mode" "$@"
    fi
}

___x_cmd_facl_get___darwin___pipe(){
    local line
    while read -r line; do
        ___x_cmd_facl_get___darwin_one "$line"
    done
}

___x_cmd_facl_get___darwin___foreach(){
    while [ $# -gt 0 ]; do
        ___x_cmd_facl_get___darwin_one "$1"
        shift
    done
}

# TODO: Performance issue ...
___x_cmd_facl_get___darwin_one(){
    if [ -d "$1" ]; then        ___x_cmd_cmds ls -led   "$1"
    else                        ___x_cmd_cmds ls -le    "$1"
    fi
}

___x_cmd_facl_get___darwin_one_visualize(){
    # ___x_cmd_cmds cat
    SKIP="$skip" ___x_cmd awk -f "${___X_CMD_ROOT_MOD}/facl/lib/get/darwin.vis.awk"
}
