cli/command/completion: deprecate ValidArgsFn

Cobra now defines a CompletionFunc for the same, so we can alias
it to that, and stop using our own definition.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn
2025-02-17 10:58:43 +01:00
parent 7607c3f945
commit 9f19820f88
8 changed files with 21 additions and 19 deletions

View File

@ -46,7 +46,7 @@ func NewStackCommand(dockerCli command.Cli) *cobra.Command {
}
// completeNames offers completion for swarm stacks
func completeNames(dockerCLI completion.APIClientProvider) completion.ValidArgsFn {
func completeNames(dockerCLI completion.APIClientProvider) cobra.CompletionFunc {
return func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
list, err := swarm.GetStacks(cmd.Context(), dockerCLI.Client())
if err != nil {