diff options
| author | Jeff Carr <[email protected]> | 2025-01-06 17:53:20 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-01-06 17:53:20 -0600 |
| commit | 5434ab498bf1ab1909f2a2511110c3c6bba280cc (patch) | |
| tree | a7113246666fb1d9b027e306e5a73f4aec858c50 /main.go | |
| parent | ec8a3688ebd8081b80293cecc5f4094ab7780943 (diff) | |
awesome bash completion work. thank good. what a timesaver
Diffstat (limited to 'main.go')
| -rw-r--r-- | main.go | 92 |
1 files changed, 38 insertions, 54 deletions
@@ -76,50 +76,38 @@ func main() { me.found = new(gitpb.Repos) argv.Checkout.Master.findRepos() doCobol() - okExit("") } + log.Info("make 'user' the default here?") + okExit("") } - if argv.Register != "" { - if err := doRegister(argv.Register); err == nil { - okExit("attempting to register " + argv.Register) - } else { - badExit(err) + // first find the repos or gopaths to operate on + if argv.Config != nil { + if argv.Config.Delete != "" { + me.forge.DeleteByGoPath(argv.Config.Delete) + me.forge.SetConfigSave(true) + okExit("") } - } - if argv.Apply != "" { - pset, err := readPatchFile(argv.Apply) - if err != nil { - badExit(err) + if argv.Config.Fix != nil { + log.Info("todo") + okExit("") } - if err = applyPatchset(pset); err == nil { - okExit("applied patch ok") + if argv.Config.Register != "" { + if err := doRegister(argv.Config.Register); err == nil { + okExit("attempting to register " + argv.Config.Register) + } else { + badExit(err) + } } - badExit(err) - } - if argv.Delete != "" { - me.forge.DeleteByGoPath(argv.Delete) - me.forge.SetConfigSave(true) - okExit("") - } - - if argv.Fix { - okExit("") - } - - // first find the repos or gopaths to operate on - if argv.Config != nil { - findConfig(argv.Config) + // findConfig(argv.Config) me.forge.ConfigPrintTable() okExit("") } log.Info("found", me.found.Len(), "repos. found", len(me.foundPaths), "paths from .config/forge") - // now, do something to all of them (or just print out a table of them) - var done bool = false if argv.Dirty != nil { findAll() // select all the repos doCheckDirtyAndConfigSave() @@ -127,41 +115,42 @@ func main() { findDirty() doCobol() okExit("") - done = true } - if argv.Scan { + if argv.Rescan != nil { me.forge.ScanGoSrc() - done = true + okExit("") } if argv.GitPull != nil { argv.GitPull.findRepos() doGitPull() - done = true + okExit("") } - if argv.GitReset { + if argv.GitReset != nil { findAll() // select all the repos doGitReset() - done = true + okExit("patches") } if argv.List != nil { argv.List.findRepos() // print out the repos doCobol() - done = true - } - if argv.PatchSet != "" { - sendDevelDiff(argv.PatchSet) - // sendMasterDiff() okExit("patches") } + if argv.Patch != nil { + if argv.Patch.Show != "" { + sendDevelDiff(argv.Patch.Show) + // sendMasterDiff() + okExit("patches") + } - if argv.ListPatchSet { - listPatches() - okExit("patches") + if argv.Patch.List { + listPatches() + okExit("patches") + } } if configSave { @@ -173,17 +162,12 @@ func main() { // nothing else was specified to be done, // then just list the table to stdout if gui.NoGui() { - if !done { - // if nothing was selected, print out a table of them on STDOUT - doCobol() - okExit("") - } + doCobol() + okExit("") } + // open the gui unless the user performed some other - // things from the command line - // basically, if you run just 'forge' it'll open the GUI - if !done { - doGui() - } + // basically, if you run just 'forge' it should open the GUI + doGui() okExit("") } |
