diff options
| author | Jeff Carr <[email protected]> | 2025-01-07 17:17:01 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-01-07 17:17:01 -0600 |
| commit | 7e47940796c6000787e531ae1846bee16ae73941 (patch) | |
| tree | ad8629e93f117094f0e98b90c6aeb7d0f4440070 /main.go | |
| parent | 5802e0f214c3b8c97bbfbb658258b011590a6e5b (diff) | |
cleanups due to autocomplete support
Diffstat (limited to 'main.go')
| -rw-r--r-- | main.go | 43 |
1 files changed, 32 insertions, 11 deletions
@@ -7,6 +7,7 @@ import ( "path/filepath" "unicode" + "go.wit.com/dev/alexflint/arg" "go.wit.com/lib/gui/shell" "go.wit.com/log" @@ -25,6 +26,16 @@ var debnames map[*gitpb.Repo]string func main() { me = new(autoType) + me.argpp = arg.MustParse(&argv) + + if argv.Bash { + argv.doBash() + os.Exit(0) + } + if len(argv.BashAuto) != 0 { + argv.doBashAuto() + os.Exit(0) + } failed = make(map[*gitpb.Repo]string) state = make(map[*gitpb.Repo]string) @@ -36,12 +47,14 @@ func main() { me.myGui = gui.New() me.myGui.Default() - if argv.RepoMap != "" { - repomap(argv.RepoMap) - okExit("") + if argv.Clone != nil { + if argv.RepoMap != "" { + repomap(argv.RepoMap) + okExit("") + } } - if argv.Upgrade { + if argv.Upgrade != nil { if argv.DryRun { log.Info("--dry-run", []string{"apt", "update"}) } else { @@ -68,7 +81,7 @@ func main() { okExit("installed") } - if argv.ListPkgs { + if argv.ListPkgs != nil { log.DaemonMode(true) defer log.DaemonMode(false) fmt.Println("Installed Packages:") @@ -184,18 +197,26 @@ func main() { if argv.DryRun { continue } - if argv.TestBuild { + if argv.TestBuild != nil { if argv.DryRun { continue } - if err := me.forge.Build(check, nil); err != nil { - log.Warn("BUILD FAILED", check.GetGoPath(), err) - failed[check] = fmt.Sprintf("%s %s %v", "go build", check.GetGoPath(), err) + if argv.Verbose { + verbose := []string{"-v", "-x"} + if err := me.forge.Build(check, verbose); err != nil { + log.Warn("BUILD FAILED", check.GetGoPath(), err) + failed[check] = fmt.Sprintf("%s %s %v", "go build", check.GetGoPath(), err) + } + } else { + if err := me.forge.Build(check, nil); err != nil { + log.Warn("BUILD FAILED", check.GetGoPath(), err) + failed[check] = fmt.Sprintf("%s %s %v", "go build", check.GetGoPath(), err) + } } continue } - if argv.MakeInstall { + if argv.MakeInstall != nil { log.Info("STARTING 'make install' in", check.GetGoPath()) if argv.DryRun { continue @@ -207,7 +228,7 @@ func main() { continue } } - if argv.DebBuild { + if argv.DebBuild != nil { buildDeb() } if len(failed) != 0 { |
