@@ -144,7 +144,7 @@ func addCompletions(cmd *cobra.Command, dockerCLI completion.APIClientProvider)
144
144
}
145
145
146
146
// completeCgroupns implements shell completion for the `--cgroupns` option of `run` and `create`.
147
- func completeCgroupns () completion. ValidArgsFn {
147
+ func completeCgroupns () cobra. CompletionFunc {
148
148
return completion .FromList (string (container .CgroupnsModeHost ), string (container .CgroupnsModePrivate ))
149
149
}
150
150
@@ -155,7 +155,7 @@ func completeDetachKeys(_ *cobra.Command, _ []string, _ string) ([]string, cobra
155
155
156
156
// completeIpc implements shell completion for the `--ipc` option of `run` and `create`.
157
157
// 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 {
159
159
return func (cmd * cobra.Command , args []string , toComplete string ) ([]string , cobra.ShellCompDirective ) {
160
160
if len (toComplete ) > 0 && strings .HasPrefix ("container" , toComplete ) { //nolint:gocritic // not swapped, matches partly typed "container"
161
161
return []string {"container:" }, cobra .ShellCompDirectiveNoSpace
@@ -175,7 +175,7 @@ func completeIpc(dockerCLI completion.APIClientProvider) func(cmd *cobra.Command
175
175
}
176
176
177
177
// 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 {
179
179
return func (cmd * cobra.Command , args []string , toComplete string ) ([]string , cobra.ShellCompDirective ) {
180
180
return postfixWith (":" , containerNames (dockerCLI , cmd , args , toComplete )), cobra .ShellCompDirectiveNoSpace
181
181
}
@@ -184,7 +184,7 @@ func completeLink(dockerCLI completion.APIClientProvider) func(cmd *cobra.Comman
184
184
// completeLogDriver implements shell completion for the `--log-driver` option of `run` and `create`.
185
185
// The log drivers are collected from a call to the Info endpoint with a fallback to a hard-coded list
186
186
// of the build-in log drivers.
187
- func completeLogDriver (dockerCLI completion.APIClientProvider ) completion. ValidArgsFn {
187
+ func completeLogDriver (dockerCLI completion.APIClientProvider ) cobra. CompletionFunc {
188
188
return func (cmd * cobra.Command , args []string , toComplete string ) ([]string , cobra.ShellCompDirective ) {
189
189
info , err := dockerCLI .Client ().Info (cmd .Context ())
190
190
if err != nil {
@@ -206,7 +206,7 @@ func completeLogOpt(cmd *cobra.Command, _ []string, _ string) ([]string, cobra.S
206
206
}
207
207
208
208
// 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 {
210
210
return func (cmd * cobra.Command , args []string , toComplete string ) ([]string , cobra.ShellCompDirective ) {
211
211
if len (toComplete ) > 0 && strings .HasPrefix ("container" , toComplete ) { //nolint:gocritic // not swapped, matches partly typed "container"
212
212
return []string {"container:" }, cobra .ShellCompDirectiveNoSpace
@@ -277,7 +277,7 @@ func completeUlimit(_ *cobra.Command, _ []string, _ string) ([]string, cobra.She
277
277
}
278
278
279
279
// 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 {
281
281
return func (cmd * cobra.Command , _ []string , _ string ) ([]string , cobra.ShellCompDirective ) {
282
282
info , err := dockerCLI .Client ().Info (cmd .Context ())
283
283
if err != nil {
0 commit comments