From 703a296b3fd597a6b96e3b5c877bafd50b74cc90 Mon Sep 17 00:00:00 2001 From: Geoffrey Ragot Date: Sat, 12 Nov 2022 17:06:29 +0100 Subject: [PATCH] feat: expose GetCompletions (was getCompletions) --- completions.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/completions.go b/completions.go index ad7b6d0a2..f3d1ee2a3 100644 --- a/completions.go +++ b/completions.go @@ -205,7 +205,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: @@ -270,7 +270,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]