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

Add "driver" filter for network ls #22319

Merged
merged 1 commit into from
Apr 30, 2016

Conversation

thaJeztah
Copy link
Member

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

@WeiZhang555
Copy link
Contributor

👍
Need rebase 😄

The following example matches networks with the `bridge` driver:

```bash
$ docker network ls filter driver=bridge
Copy link
Contributor

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.

Copy link
Member Author

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)

@vdemeester
Copy link
Member

Design LGTM too 👼

@@ -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" ) )
Copy link
Member Author

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

Copy link
Member

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.

@thaJeztah
Copy link
Member Author

Rebased, fixed docs, and attempted to update bash completion :-)

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>
@thaJeztah
Copy link
Member Author

updated the bash completion; @albers ptal (and thanks!)

@sdurrheimer
Copy link
Contributor

I will work on zsh completion as soon as possible.

@thaJeztah
Copy link
Member Author

Thanks @sdurrheimer!

@albers
Copy link
Member

albers commented Apr 29, 2016

bash completion LGTM, good work!

@calavera
Copy link
Contributor

LGTM

1 similar comment
@vdemeester
Copy link
Member

LGTM

@vdemeester
Copy link
Member

Docs too 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature Request: Filter on network driver
8 participants