@@ -144,7 +144,7 @@ func addCompletions(cmd *cobra.Command, dockerCLI completion.APIClientProvider)
144144}
145145
146146// completeCgroupns implements shell completion for the `--cgroupns` option of `run` and `create`.
147- func completeCgroupns () completion. ValidArgsFn {
147+ func completeCgroupns () cobra. CompletionFunc {
148148 return completion .FromList (string (container .CgroupnsModeHost ), string (container .CgroupnsModePrivate ))
149149}
150150
@@ -155,7 +155,7 @@ func completeDetachKeys(_ *cobra.Command, _ []string, _ string) ([]string, cobra
155155
156156// completeIpc implements shell completion for the `--ipc` option of `run` and `create`.
157157// The completion is partly composite.
158- func completeIpc (dockerCLI completion.APIClientProvider ) func ( cmd * cobra.Command , args [] string , toComplete string ) ([] string , cobra. ShellCompDirective ) {
158+ func completeIpc (dockerCLI completion.APIClientProvider ) cobra.CompletionFunc {
159159 return func (cmd * cobra.Command , args []string , toComplete string ) ([]string , cobra.ShellCompDirective ) {
160160 if len (toComplete ) > 0 && strings .HasPrefix ("container" , toComplete ) { //nolint:gocritic // not swapped, matches partly typed "container"
161161 return []string {"container:" }, cobra .ShellCompDirectiveNoSpace
@@ -175,7 +175,7 @@ func completeIpc(dockerCLI completion.APIClientProvider) func(cmd *cobra.Command
175175}
176176
177177// completeLink implements shell completion for the `--link` option of `run` and `create`.
178- func completeLink (dockerCLI completion.APIClientProvider ) func ( cmd * cobra.Command , args [] string , toComplete string ) ([] string , cobra. ShellCompDirective ) {
178+ func completeLink (dockerCLI completion.APIClientProvider ) cobra.CompletionFunc {
179179 return func (cmd * cobra.Command , args []string , toComplete string ) ([]string , cobra.ShellCompDirective ) {
180180 return postfixWith (":" , containerNames (dockerCLI , cmd , args , toComplete )), cobra .ShellCompDirectiveNoSpace
181181 }
@@ -184,7 +184,7 @@ func completeLink(dockerCLI completion.APIClientProvider) func(cmd *cobra.Comman
184184// completeLogDriver implements shell completion for the `--log-driver` option of `run` and `create`.
185185// The log drivers are collected from a call to the Info endpoint with a fallback to a hard-coded list
186186// of the build-in log drivers.
187- func completeLogDriver (dockerCLI completion.APIClientProvider ) completion. ValidArgsFn {
187+ func completeLogDriver (dockerCLI completion.APIClientProvider ) cobra. CompletionFunc {
188188 return func (cmd * cobra.Command , args []string , toComplete string ) ([]string , cobra.ShellCompDirective ) {
189189 info , err := dockerCLI .Client ().Info (cmd .Context ())
190190 if err != nil {
@@ -206,7 +206,7 @@ func completeLogOpt(cmd *cobra.Command, _ []string, _ string) ([]string, cobra.S
206206}
207207
208208// completePid implements shell completion for the `--pid` option of `run` and `create`.
209- func completePid (dockerCLI completion.APIClientProvider ) func ( cmd * cobra.Command , args [] string , toComplete string ) ([] string , cobra. ShellCompDirective ) {
209+ func completePid (dockerCLI completion.APIClientProvider ) cobra.CompletionFunc {
210210 return func (cmd * cobra.Command , args []string , toComplete string ) ([]string , cobra.ShellCompDirective ) {
211211 if len (toComplete ) > 0 && strings .HasPrefix ("container" , toComplete ) { //nolint:gocritic // not swapped, matches partly typed "container"
212212 return []string {"container:" }, cobra .ShellCompDirectiveNoSpace
@@ -277,7 +277,7 @@ func completeUlimit(_ *cobra.Command, _ []string, _ string) ([]string, cobra.She
277277}
278278
279279// completeVolumeDriver contacts the API to get the built-in and installed volume drivers.
280- func completeVolumeDriver (dockerCLI completion.APIClientProvider ) completion. ValidArgsFn {
280+ func completeVolumeDriver (dockerCLI completion.APIClientProvider ) cobra. CompletionFunc {
281281 return func (cmd * cobra.Command , _ []string , _ string ) ([]string , cobra.ShellCompDirective ) {
282282 info , err := dockerCLI .Client ().Info (cmd .Context ())
283283 if err != nil {
0 commit comments