diff options
| author | Jeff Carr <[email protected]> | 2025-01-28 13:58:41 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-01-28 13:58:41 -0600 |
| commit | dd7355571d80b4d6c970e417df85244dbfd253e0 (patch) | |
| tree | 3df9cc7c853749d742fb5435a903b5c92c5652ec | |
| parent | 91c28de514b1a41e2355714f5352f5438dbe34a2 (diff) | |
add 'forge find patches'
| -rw-r--r-- | argv.go | 13 | ||||
| -rw-r--r-- | argvAutoshell.go | 2 | ||||
| -rw-r--r-- | find.go | 19 |
3 files changed, 27 insertions, 7 deletions
@@ -94,12 +94,13 @@ type DirtyCmd struct { } type FindCmd struct { - All bool `arg:"--all" help:"select every repo (the default)"` - Mine bool `arg:"--mine" help:"your repos as defined in the forge config"` - Favorites bool `arg:"--favorites" help:"your repos configured as favorites"` - Private bool `arg:"--private" help:"your private repos from your .config/forge/"` - Dirty bool `arg:"--dirty" help:"only use dirty git repos"` - User bool `arg:"--user" help:"show repos on the user branch"` + Patches *EmptyCmd `arg:"subcommand:patches" help:"show repos that have patches"` + All bool `arg:"--all" help:"select every repo (the default)"` + Mine bool `arg:"--mine" help:"your repos as defined in the forge config"` + Favorites bool `arg:"--favorites" help:"your repos configured as favorites"` + Private bool `arg:"--private" help:"your private repos from your .config/forge/"` + Dirty bool `arg:"--dirty" help:"only use dirty git repos"` + User bool `arg:"--user" help:"show repos on the user branch"` // ReadOnly bool `arg:"--readonly" help:"include read-only repos"` } diff --git a/argvAutoshell.go b/argvAutoshell.go index 96c5e14..725efdb 100644 --- a/argvAutoshell.go +++ b/argvAutoshell.go @@ -36,7 +36,7 @@ func (args) doBashAuto() { case "examine": fmt.Println("fix") case "list": - fmt.Println("--all --mine --favorites --private") + fmt.Println("--all --mine --favorites --private patches") case "pull": fmt.Println("--all --mine --favorites --private") case "patch": @@ -17,6 +17,11 @@ func (f *FindCmd) findRepos() { return } + if argv.List.Patches != nil { + findReposWithPatches() + return + } + if f.All { findAll() return @@ -113,3 +118,17 @@ func findUser() { } } } + +func findReposWithPatches() { + all := me.forge.Repos.SortByFullPath() + for all.Scan() { + repo := all.Next() + if repo.IsDirty() { + me.found.AppendByGoPath(repo) + continue + } + if repo.GetUserVersion() != repo.GetDevelVersion() { + me.found.AppendByGoPath(repo) + } + } +} |
