-
Notifications
You must be signed in to change notification settings - Fork 18.6k
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
Add "driver" filter for network ls #22319
Conversation
👍 |
The following example matches networks with the `bridge` driver: | ||
|
||
```bash | ||
$ docker network ls filter driver=bridge |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-f
or --filter
should be used instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh! thanks for catching that; I'll update when I'm at my computer (public holiday today in the Netherlands)
Design LGTM too 👼 |
a21d59c
to
865c785
Compare
@@ -1396,7 +1396,7 @@ _docker_network_ls() { | |||
|
|||
case "$prev" in | |||
--filter|-f) | |||
COMPREPLY=( $( compgen -S = -W "id name type" -- "$cur" ) ) | |||
COMPREPLY=( $( compgen -S = -W "driver id label name type" -- "$cur" ) ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ping @albers I think this is where it needs to be added for bash completion
also @sdurrheimer I couldn't find the --f
/ --filter
option for zsh-completion. I think it may need to be added here; https://github.com/docker/docker/blob/master/contrib/completion/zsh/_docker#L422-L426
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@thaJeztah Hey, that's cool. Your're diving into the completions.
The completion is correct.
You could also add the secondary completion to https://github.com/docker/docker/blob/master/contrib/completion/bash/docker#L1380-1395, see https://github.com/docker/docker/blob/master/contrib/completion/bash/docker#L1327 for how to get the possible values.
Or just give me a ping if I should add this later.
Rebased, fixed docs, and attempted to update bash completion :-) |
865c785
to
a376049
Compare
This add a new filter to 'docker network ls' to allow filtering by driver-name. Contrary to "ID" and "name" filters, this filter only supports an *exact* match. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
a376049
to
23e418b
Compare
updated the bash completion; @albers ptal (and thanks!) |
I will work on zsh completion as soon as possible. |
Thanks @sdurrheimer! |
bash completion LGTM, good work! |
LGTM |
1 similar comment
LGTM |
Docs too 😉 |
This add a new filter to
docker network ls
to allow filtering by driver-name.Contrary to "ID" and "name" filters, this filter only supports an exact match.
fixes #22315