diff options
| author | Jeff Carr <[email protected]> | 2025-10-28 12:12:05 -0500 | 
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-10-28 12:12:05 -0500 | 
| commit | 7b9a36df98b5dbad66443e69f8d28ee8c0a66940 (patch) | |
| tree | 47707412f14ee090b2b3243500e1fe18a4533a5d | |
| parent | ad6d1a1e535a489ce5e9e602d07ac4c03d753f80 (diff) | |
tracking down more cases of argv
| -rw-r--r-- | complete.go | 10 | 
1 files 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 <tab> 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()  | 
