mirror of
				https://gitea.com/gitea/tea.git
				synced 2025-10-31 01:05:26 +01:00 
			
		
		
		
	Add tea repos search, improve repo listing (#215)
				
					
				
			Merge branch 'master' into add-repo-search-improve-listing-closes-#210 Merge branch 'master' into add-repo-search-improve-listing-closes-#210 fixup! repos list: client side filtering for repo type fix --private flag repos list: client side filtering for repo type repos list: listing of starred repos repos search: rename --mode to --type repo search: prioritize own user UX tradeoff between usefulness & response speed fix -O owner flag filter rework repo list, add repo search repo search is mostly the old behaviour of repo list Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: Norwin Roosen <git@nroo.de> Reviewed-on: https://gitea.com/gitea/tea/pulls/215 Reviewed-by: 6543 <6543@noreply.gitea.io> Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
This commit is contained in:
		| @@ -9,8 +9,47 @@ import ( | ||||
| 	"strings" | ||||
|  | ||||
| 	"code.gitea.io/sdk/gitea" | ||||
| 	"code.gitea.io/tea/cmd/flags" | ||||
| ) | ||||
|  | ||||
| // ReposList prints a listing of the repos | ||||
| func ReposList(rps []*gitea.Repository) { | ||||
| 	if len(rps) == 0 { | ||||
| 		fmt.Println("No repositories found") | ||||
| 		return | ||||
| 	} | ||||
|  | ||||
| 	headers := []string{ | ||||
| 		"Name", | ||||
| 		"Type", | ||||
| 		"SSH", | ||||
| 		"Owner", | ||||
| 	} | ||||
| 	var values [][]string | ||||
|  | ||||
| 	for _, rp := range rps { | ||||
| 		var mode = "source" | ||||
| 		if rp.Fork { | ||||
| 			mode = "fork" | ||||
| 		} | ||||
| 		if rp.Mirror { | ||||
| 			mode = "mirror" | ||||
| 		} | ||||
|  | ||||
| 		values = append( | ||||
| 			values, | ||||
| 			[]string{ | ||||
| 				rp.FullName, | ||||
| 				mode, | ||||
| 				rp.SSHURL, | ||||
| 				rp.Owner.UserName, | ||||
| 			}, | ||||
| 		) | ||||
| 	} | ||||
|  | ||||
| 	OutputList(flags.GlobalOutputValue, headers, values) | ||||
| } | ||||
|  | ||||
| // RepoDetails print an repo formatted to stdout | ||||
| func RepoDetails(repo *gitea.Repository, topics []string) { | ||||
| 	output := repo.FullName | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Norwin
					Norwin