diff options
| author | Jeff Carr <[email protected]> | 2025-10-03 01:05:11 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-10-03 01:05:11 -0500 |
| commit | 4acdb3bce3d7afb5f9218ac958b235358493563c (patch) | |
| tree | 7b7c16bdf5efac5413f0003356208864e348d43e /structs.go | |
| parent | 01fa86c6f69dc7f34b92f98c0d45ff93c324da9f (diff) | |
more autocomplete work
Diffstat (limited to 'structs.go')
| -rw-r--r-- | structs.go | 38 |
1 files changed, 36 insertions, 2 deletions
@@ -4,16 +4,50 @@ package main import ( + "sync" + "go.wit.com/lib/gui/prep" "go.wit.com/lib/protobuf/forgepb" + "go.wit.com/lib/protobuf/gitpb" "go.wit.com/lib/protobuf/zoopb" ) -var me *autoType +var me *mainType // this app's variables -type autoType struct { +type mainType struct { + once sync.Once // one-time initialized data auto *prep.Auto // more experiments for bash handling forge *forgepb.Forge // your customized repo preferences and settings machine *zoopb.Machine // your customized repo preferences and settings } + +// move these to mainType +var failed map[*gitpb.Repo]string +var state map[*gitpb.Repo]string +var debnames map[*gitpb.Repo]string + +func initForge() { + if me.forge == nil { + me.forge = forgepb.Init() + me.forge.Config.DumpENV() + } + initMachine() +} + +func initMachine() { + if me.machine == nil { + me.machine, _ = zoopb.InitMachine() + } +} + +func initMain() { + // autocomplete must be processed before there is anything sent to STDOUT or STDERR + me.auto = prep.Bash3(&argv) // add support for bash autocomplete with go-arg + + failed = make(map[*gitpb.Repo]string) + state = make(map[*gitpb.Repo]string) + debnames = make(map[*gitpb.Repo]string) + + dumpDebug() +} |
