diff options
| author | Jeff Carr <[email protected]> | 2025-10-16 13:58:28 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-10-17 01:45:59 -0500 |
| commit | 411226cf9df0814ff8e714958da87c853b519bc6 (patch) | |
| tree | eea63f72a2614a0cec3c844edbf7cf162e4257e2 /theMagicOfAutocomplete.go | |
| parent | 28839452b290b83d409193044c5737a92cc1ec3e (diff) | |
A new life awaits you in the Off-world colonies!v0.0.39
Diffstat (limited to 'theMagicOfAutocomplete.go')
| -rw-r--r-- | theMagicOfAutocomplete.go | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/theMagicOfAutocomplete.go b/theMagicOfAutocomplete.go index ae0888d..2b345a4 100644 --- a/theMagicOfAutocomplete.go +++ b/theMagicOfAutocomplete.go @@ -1,4 +1,4 @@ -package prep +package argvpb // This is where the actual autocomplete happens // lots of the fun magic is in here @@ -15,7 +15,7 @@ import ( timestamppb "google.golang.org/protobuf/types/known/timestamppb" ) -func Autocomplete(dest any) *Auto { +func Autocomplete(dest any) *Argv { me = new(AutoArgs) // todo: redo this findAppInfo(dest) // parses back to main() for argv info @@ -32,10 +32,10 @@ func Autocomplete(dest any) *Auto { me.pb = parseArgv(me.ARGNAME) // the argv history - all := NewAutos() + all := NewArgvs() // initializes the application config file - config.Init(me.ARGNAME, me.VERSION, me.BUILDTIME, me.pb.Argv) + config.Init(me.ARGNAME, me.VERSION, me.BUILDTIME, me.pb.Real) // loads the autocomplete history file err := config.LoadCache(all, "argv", me.ARGNAME) // @@ -78,7 +78,7 @@ func Autocomplete(dest any) *Auto { // set the duration since the last auto complete // find the last entry. this is dumb way to do it - last := new(Auto) + last := new(Argv) last.Ctime = timestamppb.New(time.Now().Add(-time.Second)) for found := range all.IterAll() { last = found @@ -95,7 +95,7 @@ func Autocomplete(dest any) *Auto { // roll the autocomplete file if all.Len() > 15 { me.pb.Debugf("DEBUG: trim() history is over 100 len=%d vs new=%d", all.Len(), all.Len()-90) - all.Autos = all.Autos[all.Len()-10:] + all.Argvs = all.Argvs[all.Len()-10:] // newall.Autos = all.Autos[0:10] // for _, found := range all.Autos[0:10] { // newall.Append(found) @@ -118,7 +118,7 @@ func Autocomplete(dest any) *Auto { } flags := []string{} - for _, s := range me.pb.Argv { + for _, s := range me.pb.Real { if s == "--autodebug" { continue } @@ -174,7 +174,7 @@ func Autocomplete(dest any) *Auto { } if me.autoFunc == nil { - me.pb.SubCommand(me.pb.Argv...) + me.pb.SubCommand(me.pb.Real...) } else { me.autoFunc(me.pb) // run the autocomplete function the user made for their application } |
