summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-09-17 20:54:52 -0500
committerJeff Carr <[email protected]>2025-09-17 20:54:52 -0500
commit9bc6d030e5ef022dd7dde01caf5bdbf6e1bbaa69 (patch)
treee1ef750582d5cb6f6029701ebb2aca91a730bab6
parentb8252f5caa86e3402096a73cee68d362020014a7 (diff)
something to debug if under 400ms
-rw-r--r--argv.go10
1 files changed, 8 insertions, 2 deletions
diff --git a/argv.go b/argv.go
index adadd09..b5f15c5 100644
--- a/argv.go
+++ b/argv.go
@@ -6,8 +6,10 @@ package main
import (
"fmt"
"os"
+ "time"
"go.wit.com/lib/gui/prep"
+ "go.wit.com/lib/gui/shell"
)
/*
@@ -155,9 +157,13 @@ forge -- a tool to manage lots of git repos. forge includes a GUI and TUI.
// arg0 should be the last entry
// arg1 should be the 'current' thing the user is typing
-// it should be '' if the user doesn't have a partial string to match
+// it should be empty if the user doesn't have a partial string to match
func DoAutoComplete(autoArgv *prep.Auto) {
- fmt.Fprintf(os.Stderr, "stuff --gui --all '%s' '%s' %v\n", autoArgv.Arg0, autoArgv.Arg1, autoArgv.Argv)
+ dur := autoArgv.Duration.AsDuration()
+ if dur < time.Millisecond*300 {
+ autoArgv.Debug = true
+ autoArgv.Debugf("TODO: show extended help here '%s' '%s' %v dur=%v\n", autoArgv.Arg0, autoArgv.Arg1, autoArgv.Argv, shell.FormatDuration(dur))
+ }
switch autoArgv.Argv[0] {
case "checkout":