Add Pagination Options for List Subcomands (#204)

Add Pagination Options for List subcomands

Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://gitea.com/gitea/tea/pulls/204
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-by: Norwin <noerw@noreply.gitea.io>
This commit is contained in:
6543
2020-09-27 12:07:46 +00:00
parent 887495f38f
commit cf2c18c32b
9 changed files with 62 additions and 27 deletions

View File

@ -59,6 +59,8 @@ var CmdReposList = cli.Command{
Required: false,
Usage: "Filter archived repos (true|false)",
},
&PaginationPageFlag,
&PaginationLimitFlag,
}, LoginOutputFlags...),
}
@ -189,10 +191,11 @@ func runReposList(ctx *cli.Context) error {
}
rps, _, err := client.SearchRepos(gitea.SearchRepoOptions{
OwnerID: ownerID,
IsPrivate: isPrivate,
IsArchived: isArchived,
Type: mode,
ListOptions: getListOptions(ctx),
OwnerID: ownerID,
IsPrivate: isPrivate,
IsArchived: isArchived,
Type: mode,
})
if err != nil {
return err