# shellcheck shell=dash
___x_cmd log init fish

xrc:mod:lib     fish        __setup ddgo __sysco

___x_cmd_fish___main(){
    [ "$#" -gt 0 ] || {
        ___x_cmd_fish___cmd
        return
    }

    local op="$1"; shift
    case "$op" in
        -h|--help)      ___x_cmd help -m fish               "$@" ;;
        --setup-is-required)
                        ___x_cmd_fish___setup_is_required   "$@" ;;
        setup|--setup)  ___x_cmd_fish___setup               "$@" ;;
        :|ddgo)         ___x_cmd_fish_ddgo                  "$@" ;;

        --sysco)        ___x_cmd_fish___sysco               "$@" ;;
        --syscoco)      ___x_cmd_fish___syscoco             "$@" ;;
        *)              ___x_cmd_fish___cmd                 "$@" ;;
    esac
}

___x_cmd_fish___cmd(){
    if ___x_cmd hascmd fish; then
        ___x_cmd_fish___cmd(){
            ___x_cmd_cmds fish "$@"
        }
    else
        ! ___x_cmd os is win || N=fish M='Currently, downloading Fish using Pixi is not supported on Windows' log:ret:1
        ___x_cmd_fish___cmd(){
            ___x_cmd pixi exec fish "$@"
        }
    fi || return
    ___x_cmd_fish___cmd "$@"
}
