Move from --gitlab flags to global --remote flags

This commit is contained in:
2024-01-17 10:06:20 -05:00
parent f33199bd7b
commit 702f599f5f
19 changed files with 152 additions and 121 deletions

View File

@@ -43,7 +43,7 @@ func (c *Cache) AddProjects(gitProjects ...*projects.Project) {
// This command will only dump projects that have
// been cloned locally. Setting all to true will list all projects
func (c *Cache) DumpString(all bool, search string, gitlabs ...string) string {
func (c *Cache) DumpString(all bool, search string, remotes ...string) string {
str := strings.Builder{}
var term string
if all {
@@ -56,7 +56,7 @@ func (c *Cache) DumpString(all bool, search string, gitlabs ...string) string {
for _, project := range projects {
if !all && !c.IsProjectCloned(project) {
continue
} else if len(gitlabs) > 0 && !slices.Contains(gitlabs, project.Remote) {
} else if len(remotes) > 0 && !slices.Contains(remotes, project.Remote) {
continue
}
str.WriteString(" - " + pterm.FgLightBlue.Sprint(project.Name) + " (")