From 9bc6d030e5ef022dd7dde01caf5bdbf6e1bbaa69 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Wed, 17 Sep 2025 20:54:52 -0500 Subject: [PATCH] something to debug if under 400ms --- argv.go | 10 ++++++++-- 1 file 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":