diff options
| author | Jeff Carr <[email protected]> | 2025-07-01 18:23:38 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-07-01 18:23:38 -0500 |
| commit | d2a0aa3098e48d32f41abf0a90340543775366d7 (patch) | |
| tree | 4bf550ac018ba21cdf1224c8160bd0df30c77417 /find.go | |
| parent | 47b7222445a382445e7a5d8ced74ebeec17810ec (diff) | |
more doFind() cleanups
Diffstat (limited to 'find.go')
| -rw-r--r-- | find.go | 29 |
1 files changed, 23 insertions, 6 deletions
@@ -14,6 +14,23 @@ import ( // // by default, it adds every repo +func doFind() *gitpb.Repos { + if argv.List == nil { + return findAll() + } + + if argv.List.Mine { + findMine() + return me.found + } + + if argv.List.Dirty { + return findDirty() + } + + return findAll() +} + func (f *FindCmd) findRepos() *gitpb.Repos { if f == nil { findMine() @@ -21,8 +38,7 @@ func (f *FindCmd) findRepos() *gitpb.Repos { } if f.All { - findAll() - return me.found + return findAll() } if f.Private { @@ -49,8 +65,7 @@ func (f *FindCmd) findRepos() *gitpb.Repos { return me.found } - findAll() - return me.found + return findAll() } func findPrivate() { @@ -94,10 +109,12 @@ func findDirty() *gitpb.Repos { return found } -func findAll() { +func findAll() *gitpb.Repos { + found := gitpb.NewRepos() for repo := range me.forge.Repos.IterByFullPath() { - me.found.AppendByGoPath(repo) + found.AppendByGoPath(repo) } + return found } func findUser() { |
