diff options
| author | Jeff Carr <[email protected]> | 2025-10-12 04:51:16 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-10-12 04:51:16 -0500 |
| commit | a4e6b6bf814335ba972a975317381c9585015d5b (patch) | |
| tree | a8b09387d05ea5100dec96247c2caebe20aa828e | |
| parent | 890782893d553cb6dfdb42368b75fa9e8e893ff5 (diff) | |
minorv0.0.32
| -rw-r--r-- | auto.proto | 2 | ||||
| -rw-r--r-- | parseArgv.go | 5 | ||||
| -rw-r--r-- | theMagicOfAutocomplete.go | 1 |
3 files changed, 3 insertions, 5 deletions
@@ -23,6 +23,8 @@ message Auto { // `autogenpb:marshal` ` bool newline = 13; // was a newline was sent to STDERR? string last = 14; // the last arg repeated string goargs = 15; // what to send to alex flint's go-args for help + bool fast = 16; // was the user fast last time? + string fastcmd = 17; // what subcommand was the user fast on? } message Autos { // `autogenpb:marshal` `autogenpb:sort` `autogenpb:nomutex` diff --git a/parseArgv.go b/parseArgv.go index 1fdaf5f..a1cd20e 100644 --- a/parseArgv.go +++ b/parseArgv.go @@ -29,11 +29,6 @@ func parseArgv(argname string) *Auto { } } - // "complete -C /usr/bin/argv forge" bash ENV values: - // * `COMP_LINE`: A string containing the entire current command line (forge first second third forth ). This is what you are looking for. - // * `COMP_POINT`: A number indicating the cursor's position (index) within the COMP_LINE. - // * `COMP_WORDS`: An array in Bash (seen differently by Go) containing each individual word on the command line. - // * `COMP_CWORD`: A number indicating the index of the word the cursor is currently on within the COMP_WORDS array. if len(os.Args) > 1 && os.Args[1] == pb.Argname { pb.IsAuto = true parts := strings.Split(os.Getenv("COMP_LINE"), " ") diff --git a/theMagicOfAutocomplete.go b/theMagicOfAutocomplete.go index e107319..e6c4daf 100644 --- a/theMagicOfAutocomplete.go +++ b/theMagicOfAutocomplete.go @@ -32,6 +32,7 @@ func Autocomplete(dest any) *Auto { dur := pb.Duration.AsDuration() if dur < time.Millisecond*200 { pb.Debug = true + pb.Fast = true } arg.Register(&argBash) |
