summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-10-17 05:33:04 -0500
committerJeff Carr <[email protected]>2025-10-17 05:33:04 -0500
commit6294b7b53c94fa77ac8ef3ba466b1cf032bdc6a8 (patch)
treef8126d99754624409854f84742650b7e3652e01b
parent411226cf9df0814ff8e714958da87c853b519bc6 (diff)
dump old stuff
-rw-r--r--sendStrings.go42
-rw-r--r--theMagicOfAutocomplete.go2
2 files changed, 1 insertions, 43 deletions
diff --git a/sendStrings.go b/sendStrings.go
index 546746d..827e690 100644
--- a/sendStrings.go
+++ b/sendStrings.go
@@ -12,16 +12,6 @@ import (
"go.wit.com/log"
)
-// deprecate
-func (pb *Argv) Autocomplete3(sendthis []string) {
- pb.SendStrings(sendthis)
-}
-
-// deprecate
-func (pb *Argv) Autocomplete2(sendthis string) {
- pb.SendStrings(strings.Split(sendthis, " "))
-}
-
// the application must send a string "help run list"
func (pb *Argv) SendString(sendthis string) {
pb.SendStrings(strings.Split(sendthis, " "))
@@ -29,30 +19,6 @@ func (pb *Argv) SendString(sendthis string) {
// the application must send an array []string{"help", "run", "list"}
func (pb *Argv) SendStrings(parts []string) {
- /*
- dur := pb.Duration.AsDuration()
- if dur < time.Millisecond*200 {
- pb.Debug = true
- // pb.Debugf("TODO: show extended help here '%s' '%s' %v dur=%v\n", pb.Arg0, pb.Arg1, pb.Argv, config.FormatDuration(dur))
- // pb.PrintDebug()
- // fmt.Println(" ")
- if me.pp == nil {
- pb.Debugf("me.pp == nil")
- } else {
- pb.Debugf("me.pp != nil")
- if pb.Fast {
- // this means the user is pressing tab. no longer doing stderr
- } else {
- if pb.Cmd == "" {
- me.pp.WriteHelp(os.Stderr)
- } else {
- me.pp.WriteHelpForSubcommand(os.Stderr, pb.Cmd)
- }
- }
- }
- }
- */
-
// parts := strings.Split(sendthis, " ")
var all []string
for _, part := range parts {
@@ -68,14 +34,6 @@ func (pb *Argv) SendStrings(parts []string) {
all = append(all, part)
}
fmt.Printf("%s", strings.Join(all, " "))
- /*
- if dur > time.Millisecond*200 {
- if dur < time.Millisecond*800 {
- // fmt.Println("a b")
- fmt.Println(pb.Partial + " hello world")
- }
- }
- */
}
// try out a new name. also, this whole thing is dumb and needs to be redone
diff --git a/theMagicOfAutocomplete.go b/theMagicOfAutocomplete.go
index 2b345a4..a5516d2 100644
--- a/theMagicOfAutocomplete.go
+++ b/theMagicOfAutocomplete.go
@@ -153,7 +153,7 @@ func Autocomplete(dest any) *Argv {
// this is a work in progress
if me.pb.Last == "--gui" {
me.pb.Debugf("DEBUG: last=%s found --gui", me.pb.Last)
- me.pb.Autocomplete2("andlabs gogui")
+ me.pb.SendString("andlabs gogui")
os.Exit(0)
} else {
// me.pb.Debugf("DEBUG: NO MATCH last='%s' found key '%s' = %s", me.pb.Last, key, val)