move things into 'find' and 'do' subcommands
This commit is contained in:
parent
bd332301be
commit
2b087365f6
18
argv.go
18
argv.go
|
@ -23,7 +23,7 @@ type DoCmd struct {
|
||||||
GitReset bool `arg:"--git-reset" help:"run 'git reset --hard'"`
|
GitReset bool `arg:"--git-reset" help:"run 'git reset --hard'"`
|
||||||
Build bool `arg:"--build" default:"true" help:"try to build it"`
|
Build bool `arg:"--build" default:"true" help:"try to build it"`
|
||||||
Install bool `arg:"--install" help:"also try to install it"`
|
Install bool `arg:"--install" help:"also try to install it"`
|
||||||
// DoRedoGoMod bool `arg:"--RedoGoMod" help:"remake all the go.sum and go.mod files"`
|
RedoGoMod bool `arg:"--RedoGoMod" help:"remake all the go.sum and go.mod files"`
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -48,15 +48,15 @@ type args struct {
|
||||||
// FindMine bool `arg:"--find-mine" help:"download private and writeable repos"`
|
// FindMine bool `arg:"--find-mine" help:"download private and writeable repos"`
|
||||||
// FindFavorites bool `arg:"--find-favorites" help:"download repos marked as favorites"`
|
// FindFavorites bool `arg:"--find-favorites" help:"download repos marked as favorites"`
|
||||||
// FindPrivate bool `arg:"--find-private" help:"list private repos in .config/forge/"`
|
// FindPrivate bool `arg:"--find-private" help:"list private repos in .config/forge/"`
|
||||||
DoList bool `arg:"--do-list" help:"list found repos"`
|
// DoList bool `arg:"--do-list" help:"list found repos"`
|
||||||
DoScan bool `arg:"--do-scan" help:"rescan your repos"`
|
// DoScan bool `arg:"--do-scan" help:"rescan your repos"`
|
||||||
DoClone bool `arg:"--do-clone" help:"go-clone things you are missing"`
|
// DoClone bool `arg:"--do-clone" help:"go-clone things you are missing"`
|
||||||
DoForce bool `arg:"--do-force" help:"force redo go-clone"`
|
DoForce bool `arg:"--do-force" help:"force redo go-clone"`
|
||||||
DoGitPull bool `arg:"--do-git-pull" help:"run 'git pull' on all your repos"`
|
// DoGitPull bool `arg:"--do-git-pull" help:"run 'git pull' on all your repos"`
|
||||||
DoGitReset bool `arg:"--do-git-reset" help:"run 'git reset --hard' on all read-only repos"`
|
// DoGitReset bool `arg:"--do-git-reset" help:"run 'git reset --hard' on all read-only repos"`
|
||||||
DoBuild bool `arg:"--do-build" default:"true" help:"also try to build it"`
|
// DoBuild bool `arg:"--do-build" default:"true" help:"also try to build it"`
|
||||||
DoInstall bool `arg:"--do-install" help:"try to install every binary package"`
|
// DoInstall bool `arg:"--do-install" help:"try to install every binary package"`
|
||||||
DoRedoGoMod bool `arg:"--do-RedoGoMod" help:"remake all the go.sum and go.mod files"`
|
// DoRedoGoMod bool `arg:"--do-RedoGoMod" help:"remake all the go.sum and go.mod files"`
|
||||||
DoGui bool `arg:"--do-gui" help:"run the gui"`
|
DoGui bool `arg:"--do-gui" help:"run the gui"`
|
||||||
DoPatchSet bool `arg:"--do-patches" help:"make patch set"`
|
DoPatchSet bool `arg:"--do-patches" help:"make patch set"`
|
||||||
ListPatchSet bool `arg:"--list-patches" help:"make patch set"`
|
ListPatchSet bool `arg:"--list-patches" help:"make patch set"`
|
||||||
|
|
|
@ -34,9 +34,6 @@ func doGitPull() {
|
||||||
|
|
||||||
}
|
}
|
||||||
func doGitReset() {
|
func doGitReset() {
|
||||||
if !argv.DoGitReset {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
all := me.found.SortByFullPath()
|
all := me.found.SortByFullPath()
|
||||||
for all.Scan() {
|
for all.Scan() {
|
||||||
repo := all.Next()
|
repo := all.Next()
|
||||||
|
|
12
main.go
12
main.go
|
@ -119,31 +119,33 @@ func main() {
|
||||||
|
|
||||||
// now, do something to all of them (or just print out a table of them)
|
// now, do something to all of them (or just print out a table of them)
|
||||||
var done bool = false
|
var done bool = false
|
||||||
if argv.DoScan {
|
if argv.Do != nil {
|
||||||
|
if argv.Do.Scan {
|
||||||
doScan()
|
doScan()
|
||||||
done = true
|
done = true
|
||||||
}
|
}
|
||||||
|
|
||||||
if argv.DoRedoGoMod {
|
if argv.Do.RedoGoMod {
|
||||||
doRedoGoMod()
|
doRedoGoMod()
|
||||||
done = true
|
done = true
|
||||||
}
|
}
|
||||||
|
|
||||||
if argv.DoGitPull {
|
if argv.Do.GitPull {
|
||||||
doGitPull()
|
doGitPull()
|
||||||
done = true
|
done = true
|
||||||
}
|
}
|
||||||
|
|
||||||
if argv.DoGitReset {
|
if argv.Do.GitReset {
|
||||||
doGitReset()
|
doGitReset()
|
||||||
done = true
|
done = true
|
||||||
}
|
}
|
||||||
|
|
||||||
if argv.DoList {
|
if argv.Do.List {
|
||||||
// print out the repos
|
// print out the repos
|
||||||
doCobol()
|
doCobol()
|
||||||
done = true
|
done = true
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if argv.DoPatchSet {
|
if argv.DoPatchSet {
|
||||||
sendDevelDiff()
|
sendDevelDiff()
|
||||||
|
|
Loading…
Reference in New Issue