# shellcheck shell=dash disable=SC2034,SC2154
# https://gitea.com/api/swagger#/repository/repoListTeams
___x_cmd_fjo_team_repo_ls() {
    param:scope     ___x_cmd_fjo
    param:dsl       '
options:
    --id            "id of the team"                                <>
    --limit         "Results per page"                              <>:Numbers="30"
    --page          "Page number of the results to fetch."          <>:Numbers="1"
    --json|-j       "Output json data"
'
    param:run

    if ___x_cmd_gx_output_is_format; then
        ___x_cmd_fjo_get_multi "/teams/${id}/repos" | ___x_cmd_gx_output_format
    else
        ___x_cmd_fjo_get_multi "/teams/${id}/repos" | \
            x jo 2c             .id .name .full_name .private .description | \
            x csv header --add   ID  Name  RepoPath   Private  Description | \
            if [ -n "$csv" ]; then  ___x_cmd_cmds cat
            else                    x csv static_tab
            fi
    fi
}