summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-10-25 15:58:07 -0500
committerJeff Carr <[email protected]>2025-10-25 15:58:07 -0500
commitab82f99c94d1c0b0d386ca691902183b409e3d38 (patch)
tree5552c4514f88764dad434d1bc806063dd1010392
parentebe85de161734b384802e2c85fc72854ce6aae9b (diff)
still builds and runs kinda
-rw-r--r--theMagicOfAutocomplete.go25
1 files changed, 6 insertions, 19 deletions
diff --git a/theMagicOfAutocomplete.go b/theMagicOfAutocomplete.go
index 003a901..d72b46f 100644
--- a/theMagicOfAutocomplete.go
+++ b/theMagicOfAutocomplete.go
@@ -116,7 +116,7 @@ func prepareStdout() {
// this is a work in progress
if lastarg == "--gui" {
me.pb.Debugf("DEBUG: real=(%v) found --gui", me.pb.Real)
- me.pb.SendString("andlabs gogui")
+ PB.Stdout += " andlabs gogui"
return
} else {
// me.pb.Debugf("DEBUG: NO MATCH last='%s' found key '%s' = %s", last, key, val)
@@ -134,7 +134,6 @@ func prepareStdout() {
if err := me.parseFlagsFunc(); err != nil {
me.pb.Stderr += fmt.Sprintf("application parseFlags() err(%v)\n", err)
me.pb.Stderr += fmt.Sprintln("argv.parseFlags() err. probably cmd doesn't really exist in struct")
- me.all.PrintHistory(me.last.GetCmd())
me.debug = true
return
}
@@ -151,17 +150,6 @@ func prepareStdout() {
}
me.pb.HelpCounter = me.last.HelpCounter
- /*
- if me.last.Fast {
- // user is probably holding down the <TAB> key
- // me.fastcmd = me.pb.GetCmd()
- if me.pb.GetCmd() != me.last.GetCmd() {
- // do the smart something here
- // probably debug == true && printStderr()
- }
- }
- */
-
if me.pb.Fast {
if me.last.Fast {
me.pb.HelpCounter = me.last.HelpCounter + 1
@@ -204,6 +192,7 @@ func doStdoutStderr() {
savePB()
if me.debug {
me.all.PrintHistory(me.last.GetCmd())
+ me.pb.Stderr += fmt.Sprintf("pb.Stdout (%v)\n", PB.Stdout)
me.pb.PrintStderr()
} else {
if me.pb.Fast {
@@ -235,8 +224,8 @@ func examineArgvHistory() {
// so this panic() is safe and can never be triggered by normal program execution.
//
me.debug = true
- me.pb.Stderr += fmt.Sprintf("config.CreateCacheDirPB() err(%v)\n", me.Err)
me.pb.PrintStderr()
+ me.pb.Stderr += fmt.Sprintf("config.CreateCacheDirPB() err(%v)\n", me.Err)
panic("argvpb.Load() history file failed")
}
if me.debug {
@@ -286,24 +275,22 @@ func examineArgvHistory() {
// only have nil values in the .pb file. just die for now
if me.all.Len() == 0 {
+ me.debug = true
me.pb.PrintStderr()
- // todo: make a blak entry here
+ me.pb.Stderr += fmt.Sprintf("examineArgvHistory() couldn't find a valid last entry")
+ // todo: make a blank entry here
panic("examineArgvHistory() couldn't find a valid last entry")
}
// finally safe to get the last history entry
me.last = me.all.Argvs[me.all.Len()-1]
- if me.debug {
- me.all.PrintHistory(me.last.GetCmd())
- }
// compute the duration since the last time
dur := time.Since(me.last.Ctime.AsTime())
me.pb.Duration = durationpb.New(dur)
if me.pb.Duration.AsDuration() < time.Millisecond*200 {
me.pb.Fast = true
- // me.fastcmd = me.pb.GetCmd()
if me.last.Fast {
// do the smart something here
if me.pb.GetCmd() == me.last.GetCmd() {