diff options
| author | Jeff Carr <[email protected]> | 2025-10-12 09:49:06 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-10-12 09:49:06 -0500 |
| commit | 894260660b7218c023db8ba27bba478bcfffe7c1 (patch) | |
| tree | 7a663325de15297b80e2e12e29bb28329ea484f8 /theMagicOfAutocomplete.go | |
| parent | 990442bc888ca0e648c1af72c1c2fd94958fbdb6 (diff) | |
more magic. It's smarter about key repeat nowv0.0.33
Diffstat (limited to 'theMagicOfAutocomplete.go')
| -rw-r--r-- | theMagicOfAutocomplete.go | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/theMagicOfAutocomplete.go b/theMagicOfAutocomplete.go index b1bf044..e1ad4d5 100644 --- a/theMagicOfAutocomplete.go +++ b/theMagicOfAutocomplete.go @@ -107,7 +107,7 @@ func Autocomplete(dest any) *Auto { myAuto.pp, err = arg.ParseFlags(flags, dest) if err != nil { // users has command line arguments that won't parse with go-args - pb.Debugf("DEBUG: Parse error: %v", err) + pb.Debugf("DEBUG: Parse error: %v flags(%v)", err, flags) } if myAuto.pp == nil { @@ -129,6 +129,20 @@ func Autocomplete(dest any) *Auto { // pb.Debugf("DEBUG: NO MATCH last='%s' found key '%s' = %s", pb.Last, key, val) } + if pb.Fast { + if last.Fast { + os.Exit(0) + } else { + // this means the user is pressing tab. no longer doing stderr + if pb.Cmd == "" { + myAuto.pp.WriteHelp(os.Stderr) + } else { + myAuto.pp.WriteHelpForSubcommand(os.Stderr, pb.Cmd) + } + } + } else { + } + if myAuto.autoFunc == nil { pb.SubCommand(pb.Argv...) } else { |
