summaryrefslogtreecommitdiff
path: root/complete.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-10-29 01:45:33 -0500
committerJeff Carr <[email protected]>2025-10-29 01:45:33 -0500
commitb11aaefd9d5ad1a455dfaf472b2cc4f1cfdeaeed (patch)
tree63a97fc3d5168ffcf61c58ab96d503e6f2ca864d /complete.go
parent7a352b4c34d7662227f09a248079e387887157a3 (diff)
maybe it doesn't suck anymore. code might work.v1.6.7
Diffstat (limited to 'complete.go')
-rw-r--r--complete.go16
1 files changed, 7 insertions, 9 deletions
diff --git a/complete.go b/complete.go
index 0fb29c9..aba6a33 100644
--- a/complete.go
+++ b/complete.go
@@ -40,16 +40,14 @@ func ParseFlagsArgv(dest ...interface{}) (*Parser, error) {
*/
return p, err
}
- if argvpb.PB.ErrCounter < 5 {
- if argvpb.Len() == 0 {
- // user didn't enter any text and is hitting <tab> after the command itself
- p.WriteHelp(argvpb.Stderr)
- if p.match != nil {
- // calls back to the application. this allows the application to provide autocomplete matches
- p.match()
- }
- return p, errors.New("WriteHelp() worked")
+ if argvpb.Len() == 0 {
+ // user didn't enter any text and is hitting <tab> after the command itself
+ p.WriteHelp(argvpb.Stderr)
+ if p.match != nil {
+ // calls back to the application. this allows the application to provide autocomplete matches
+ p.match()
}
+ return p, errors.New("WriteHelp() worked")
}
if argvpb.PB.GetCmd() == "" {
// user is trying to get help for a subcommand