add 'forge find patches'
This commit is contained in:
parent
91c28de514
commit
dd7355571d
13
argv.go
13
argv.go
|
@ -94,12 +94,13 @@ type DirtyCmd struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
type FindCmd struct {
|
type FindCmd struct {
|
||||||
All bool `arg:"--all" help:"select every repo (the default)"`
|
Patches *EmptyCmd `arg:"subcommand:patches" help:"show repos that have patches"`
|
||||||
Mine bool `arg:"--mine" help:"your repos as defined in the forge config"`
|
All bool `arg:"--all" help:"select every repo (the default)"`
|
||||||
Favorites bool `arg:"--favorites" help:"your repos configured as favorites"`
|
Mine bool `arg:"--mine" help:"your repos as defined in the forge config"`
|
||||||
Private bool `arg:"--private" help:"your private repos from your .config/forge/"`
|
Favorites bool `arg:"--favorites" help:"your repos configured as favorites"`
|
||||||
Dirty bool `arg:"--dirty" help:"only use dirty git repos"`
|
Private bool `arg:"--private" help:"your private repos from your .config/forge/"`
|
||||||
User bool `arg:"--user" help:"show repos on the user branch"`
|
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"`
|
// ReadOnly bool `arg:"--readonly" help:"include read-only repos"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -36,7 +36,7 @@ func (args) doBashAuto() {
|
||||||
case "examine":
|
case "examine":
|
||||||
fmt.Println("fix")
|
fmt.Println("fix")
|
||||||
case "list":
|
case "list":
|
||||||
fmt.Println("--all --mine --favorites --private")
|
fmt.Println("--all --mine --favorites --private patches")
|
||||||
case "pull":
|
case "pull":
|
||||||
fmt.Println("--all --mine --favorites --private")
|
fmt.Println("--all --mine --favorites --private")
|
||||||
case "patch":
|
case "patch":
|
||||||
|
|
19
find.go
19
find.go
|
@ -17,6 +17,11 @@ func (f *FindCmd) findRepos() {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if argv.List.Patches != nil {
|
||||||
|
findReposWithPatches()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
if f.All {
|
if f.All {
|
||||||
findAll()
|
findAll()
|
||||||
return
|
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)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue