package main import ( "embed" "os/user" "strings" "go.wit.com/lib/debugger" "go.wit.com/lib/gui/repostatus" "go.wit.com/log" "go.wit.com/gui" ) //go:embed resources/* var resToolkit embed.FS func main() { me = new(autoType) me.myGui = gui.New() me.myGui.InitEmbed(resToolkit) me.myGui.Default() me.autotypistWindow = me.myGui.NewWindow("autotypist: it types faster than you can.") me.mainbox = me.autotypistWindow.NewBox("bw hbox", true) vbox1 := me.mainbox.NewVerticalBox("BOX1") globalDisplayOptions(vbox1) docsBox(vbox1) if debugger.ArgDebug() { debuggerBox(vbox1) } // disable the interface while everything is scanned me.Disable() vbox2 := me.mainbox.NewVerticalBox("BOX2") globalBuildOptions(vbox2) me.summary = submitPatchesBox(vbox2) globalResetOptions(me.mainbox) me.repos = makeRepoView() usr, _ := user.Current() if args.OnlyMe { log.Info("not scanning everything") } else { log.Info("scanning everything in ~/go/src") for i, path := range repostatus.ListGitDirectories() { // log.Info("addRepo()", i, path) path = strings.TrimPrefix(path, me.goSrcPwd.String()) path = strings.Trim(path, "/") log.Info("addRepo()", i, path) me.repos.View.AddRepo(path, "master", "devel", usr.Username) } } // process everything on the command line handleCmdLine() me.repos.View.ScanRepositories() me.Enable() // processing is done. update the repo summary box me.summary.Update() // intermittently scans the status indefinitly me.repos.View.Watchdog() }