Skip to content

Commit

Permalink
feat: expose GetCompletions (was getCompletions)
Browse files Browse the repository at this point in the history
  • Loading branch information
gfyrag authored and David Ragot committed Mar 15, 2024
1 parent a0a6ae0 commit bfd8d9b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions completions.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ func (c *Command) initCompleteCmd(args []string) {
Long: fmt.Sprintf("%[2]s is a special command that is used by the shell completion logic\n%[1]s",
"to request completion choices for the specified command-line.", ShellCompRequestCmd),
Run: func(cmd *Command, args []string) {
finalCmd, completions, directive, err := cmd.getCompletions(args)
finalCmd, completions, directive, err := cmd.GetCompletions(args)
if err != nil {
CompErrorln(err.Error())
// Keep going for multiple reasons:
Expand Down Expand Up @@ -263,7 +263,7 @@ func (c *Command) initCompleteCmd(args []string) {
}
}

func (c *Command) getCompletions(args []string) (*Command, []string, ShellCompDirective, error) {
func (c *Command) GetCompletions(args []string) (*Command, []string, ShellCompDirective, error) {
// The last argument, which is not completely typed by the user,
// should not be part of the list of arguments
toComplete := args[len(args)-1]
Expand Down

0 comments on commit bfd8d9b

Please sign in to comment.