Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cli: add shell completion #1727

Merged
merged 4 commits into from
May 9, 2023
Merged

Conversation

crazy-max
Copy link
Member

@crazy-max crazy-max commented Apr 9, 2023

closes #1674
partially solves #1072

Add completion to:

  • List builder names for --builder persistent flag and as arg for some cmds
  • Folders (context) for build command
  • List bake targets
$ docker __completeNoDesc buildx --builder ""
builder
builder2
buildkit0106
buildkit093
remote-builder
default
desktop-linux
docker201016
docker2300
docker2400
:4
Completion ended with directive: ShellCompDirectiveNoFileComp
$ docker __completeNoDesc buildx --builder "do"
docker201016
docker2300
docker2400
:4
Completion ended with directive: ShellCompDirectiveNoFileComp

For bake, can be tested within this repo:

$ docker __completeNoDesc buildx ""
bake
build
create
du
help
imagetools
inspect
ls
prune
rm
stop
use
version
:4
Completion ended with directive: ShellCompDirectiveNoFileComp
$ docker __completeNoDesc buildx bake ""
default
validate
meta-helper
_common
lint
validate-vendor
validate-docs
validate-authors
validate-generated-files
update-vendor
update-docs
update-authors
update-generated-files
mod-outdated
test
binaries
binaries-cross
release
image
image-cross
image-local
:4
Completion ended with directive: ShellCompDirectiveNoFileComp
$ docker __completeNoDesc buildx bake "v"
validate
validate-vendor
validate-docs
validate-authors
validate-generated-files
:4
Completion ended with directive: ShellCompDirectiveNoFileComp

@crazy-max crazy-max marked this pull request as ready for review April 11, 2023 07:34
crazy-max and others added 4 commits April 11, 2023 11:32
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
@jedevc jedevc added this to the v0.11.0 milestone Apr 11, 2023
@crazy-max crazy-max merged commit 621b07c into docker:master May 9, 2023
54 checks passed
@crazy-max crazy-max deleted the cmd-completion branch May 9, 2023 08:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants