# shellcheck shell=dash
___x_cmd log init find

xrc:mod:lib     find        fzf/_index

___x_cmd_find___main(){
    [ "$#" -gt 0 ] ||   set - --auto

    local op="$1";      shift
    case "$op" in
        -h|--help)  ___x_cmd help -m find       "$@" ;;
        --fzdata)   ___x_cmd_find___fz_data     "$@" ;;
        --fzfapppreview|--fzfapp)
                    ___x_cmd_find___"${op#--}"  "$@" ;;
        --auto)     ___x_cmd_find___auto        "$@" ;;
        --cmd)      ___x_cmd_find___cmd         "$@" ;;
        *)          ___x_cmd_find___cmd "$op"   "$@" ;;
    esac
}

___x_cmd_find___cmd(){
    ___x_cmd_cmds find "$@"
}

___x_cmd_find___auto(){
    if ___x_cmd_is_stdout2tty && ___x_cmd_runmode_allow_manual ; then
        ___x_cmd_find___fzfapp "$@"
    else
        ___x_cmd_find___cmd "$@"
    fi
}
