diff options
| author | Jeff Carr <[email protected]> | 2025-10-26 10:05:57 -0500 | 
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-10-26 10:05:57 -0500 | 
| commit | 06102e1f2304337782675a1f10253e67057eaecc (patch) | |
| tree | dc16a71b4ddc0afe765fecc0d0ff7b97a503f1f5 | |
| parent | 36c5feb5750061ccc4bf2d12889aed8adf795069 (diff) | |
argv changesv0.25.101
| -rw-r--r-- | complete.go | 17 | 
1 files changed, 9 insertions, 8 deletions
diff --git a/complete.go b/complete.go index 5a73931..0cd7513 100644 --- a/complete.go +++ b/complete.go @@ -92,24 +92,24 @@ func (c CleanCmd) Match(partial string) []string {  }  // sends the strings to bash or zsh that will be your options -func (a args) SendCompletionStrings(pb *argvpb.Argv) { -	if pb.IsMatch("mode.config") { +func (a args) DoAutoComplete() error { +	if argvpb.PB.IsMatch("mode.config") {  		matches := []string{"mine", "favorites"}  		fmt.Fprintf(argvpb.Stdout, strings.Join(matches, " ")) -		return +		return nil  	} -	if pb.IsMatch("mode") { +	if argvpb.PB.IsMatch("mode") {  		matches := []string{"once", "many", "mine", "favorites"}  		fmt.Fprintf(argvpb.Stdout, strings.Join(matches, " ")) -		return +		return nil  	} -	if pb.GetCmd() == "" { +	if argvpb.PB.GetCmd() == "" {  		// these are base autocomplete strings  		matches := []string{"clean", "commit", "merge", "patch", "normal", "pull", "rebuild", "generate", "config"}  		matches = append(matches, "show", "add", "fixer", "dev", "verify", "mode", "gui", "whatchanged")  		matches = append(matches, "--version", "--force", "--all")  		fmt.Fprintf(argvpb.Stdout, strings.Join(matches, " ")) -		return +		return nil  	}  	var err error  	if me.pp == nil { @@ -117,6 +117,7 @@ func (a args) SendCompletionStrings(pb *argvpb.Argv) {  		fmt.Fprintf(argvpb.Stderr, "returned from parseFlagsArgv(%v)\n", err)  	}  	err = me.pp.WriteHelpForAutocomplete(argvpb.PB.Partial, argvpb.PB.Real...) -	fmt.Fprintf(argvpb.Stderr, "returned from WriteHelpForAutocomplete() pb.Real(%v)\n", 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) +	return err  }  | 
