Skip to content

Commit b3df920

Browse files
committed
add completion for docker image pull
With this patch, completion is provided for images already present in the local image cache to help pulling the latest version of the same tag; docker pull go<tab> golang:1.12 golang:1.18.0 golang:1.21 golang:1.24 gopher:latest golang:1.13 golang:1.20 golang:1.23 golang:latest docker pull golang:<tab> 1.12 1.13 1.18.0 1.20 1.21 1.23 1.24 latest Signed-off-by: Sebastiaan van Stijn <[email protected]> (cherry picked from commit 5bf3c67) Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent b89b069 commit b3df920

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

cli/command/image/pull.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@ func newPullCommand(dockerCLI command.Cli) *cobra.Command {
4646
"category-top": "5",
4747
"aliases": "docker image pull, docker pull",
4848
},
49-
ValidArgsFunction: cobra.NoFileCompletions,
49+
// Complete with local images to help pulling the latest version
50+
// of images that are in the image cache.
51+
ValidArgsFunction: completion.ImageNames(dockerCLI, 1),
5052
}
5153

5254
flags := cmd.Flags()

0 commit comments

Comments
 (0)