netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] bridge-utils: show selected bridge
@ 2011-01-12 15:29 Anton Danilov
  2011-01-13 22:48 ` Stephen Hemminger
  0 siblings, 1 reply; 2+ messages in thread
From: Anton Danilov @ 2011-01-12 15:29 UTC (permalink / raw)
  To: netdev

diff --git a/brctl/brctl_cmd.c b/brctl/brctl_cmd.c
index d37e99c..d95fe54 100644
--- a/brctl/brctl_cmd.c
+++ b/brctl/brctl_cmd.c
@@ -338,8 +338,14 @@ static int show_bridge(const char *name, void *arg)

 static int br_cmd_show(int argc, char *const* argv)
 {
+       int i = 0;
+
        printf("bridge name\tbridge id\t\tSTP enabled\tinterfaces\n");
-       br_foreach_bridge(show_bridge, NULL);
+       if (argc == 1)
+               br_foreach_bridge(show_bridge, NULL);
+       else
+               for(i = 2; i <= argc; i++)
+                       show_bridge(argv[i - 1], NULL);
        return 0;
 }

@@ -454,7 +460,8 @@ static const struct command commands[] = {
          "<bridge> <port> <cost>\tset path cost" },
        { 3, "setportprio", br_cmd_setportprio,
          "<bridge> <port> <prio>\tset port priority" },
-       { 0, "show", br_cmd_show, "\t\t\tshow a list of bridges" },
+       { 0, "show", br_cmd_show,
+         "[ <bridge> ]\t\tshow a list of bridges" },
        { 1, "showmacs", br_cmd_showmacs,
          "<bridge>\t\tshow a list of mac addrs"},
        { 1, "showstp", br_cmd_showstp,
-- 
Anton.

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [patch] bridge-utils: show selected bridge
  2011-01-12 15:29 [patch] bridge-utils: show selected bridge Anton Danilov
@ 2011-01-13 22:48 ` Stephen Hemminger
  0 siblings, 0 replies; 2+ messages in thread
From: Stephen Hemminger @ 2011-01-13 22:48 UTC (permalink / raw)
  To: Anton Danilov; +Cc: netdev

Applied, but please add commit message next time.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-01-13 22:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-12 15:29 [patch] bridge-utils: show selected bridge Anton Danilov
2011-01-13 22:48 ` Stephen Hemminger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).