From 7b9a36df98b5dbad66443e69f8d28ee8c0a66940 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Tue, 28 Oct 2025 12:12:05 -0500 Subject: tracking down more cases of argv --- complete.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/complete.go b/complete.go index 25d5ef6..7cd0bbf 100644 --- a/complete.go +++ b/complete.go @@ -37,9 +37,9 @@ func ParseFlagsArgv(dest ...interface{}) (*Parser, error) { s := fmt.Sprintf("p.Parse() problem in argv err(%v)\n", err) panic(s) } - if argvpb.PB.HelpCounter > 3 { - argvpb.SetDebug(true) - argvpb.PB.HelpCounter = 0 + if argvpb.PB.ErrCounter > 2 || argvpb.PB.OutCounter > 5 { + argvpb.PB.ErrCounter = 0 + argvpb.PB.OutCounter = 0 if argvpb.Len() == 0 { // user didn't enter any text and is hitting after the command itself p.WriteHelp(argvpb.Stderr) @@ -55,8 +55,8 @@ func ParseFlagsArgv(dest ...interface{}) (*Parser, error) { } if argvpb.PB.GetCmd() != "" { err = p.WriteHelpForAutocomplete(argvpb.PB.Partial, argvpb.PB.Real...) - fmt.Fprintf(argvpb.Stderr, "returned from WriteHelpForAutocomplete() pb.Real(%v)\n", argvpb.PB.Real) - fmt.Fprintf(argvpb.Stderr, "returned from WriteHelpForAutocomplete(%v)\n", err) + fmt.Fprintf(argvpb.Stddbg, "returned from WriteHelpForAutocomplete() pb.Real(%v)\n", argvpb.PB.Real) + fmt.Fprintf(argvpb.Stddbg, "returned from WriteHelpForAutocomplete(%v)\n", err) if p.match != nil { // calls back to the application. this allows the application to provide autocomplete matches p.match() -- cgit v1.2.3