]> git.proxmox.com Git - mirror_iproute2.git/blobdiff - bridge/bridge.c
rdma: Properly mark RDMAtool license
[mirror_iproute2.git] / bridge / bridge.c
index 7fcfe1116f6e5a204151fd468adf662ef3670550..a50d9d59b4c5a452bf2356f0419e4eee847c0946 100644 (file)
@@ -23,14 +23,12 @@ int preferred_family = AF_UNSPEC;
 int oneline;
 int show_stats;
 int show_details;
-int show_pretty;
-int color;
+static int color;
 int compress_vlans;
 int json;
 int timestamp;
-char *batch_file;
+static const char *batch_file;
 int force;
-const char *_SL_;
 
 static void usage(void) __attribute__((noreturn));
 
@@ -42,7 +40,7 @@ static void usage(void)
 "where OBJECT := { link | fdb | mdb | vlan | monitor }\n"
 "      OPTIONS := { -V[ersion] | -s[tatistics] | -d[etails] |\n"
 "                   -o[neline] | -t[imestamp] | -n[etns] name |\n"
-"                   -c[ompressvlans] -color -p[retty] -j{son} }\n");
+"                   -c[ompressvlans] -color -p[retty] -j[son] }\n");
        exit(-1);
 }
 
@@ -99,6 +97,8 @@ static int batch(const char *name)
                return EXIT_FAILURE;
        }
 
+       rtnl_set_strict_dump(&rth);
+
        cmdlineno = 0;
        while (getcmdline(&line, &len, stdin) != -1) {
                char *largv[100];
@@ -173,10 +173,9 @@ main(int argc, char **argv)
                        NEXT_ARG();
                        if (netns_switch(argv[1]))
                                exit(-1);
-               } else if (matches(opt, "-color") == 0) {
-                       enable_color();
                } else if (matches(opt, "-compressvlans") == 0) {
                        ++compress_vlans;
+               } else if (matches_color(opt, &color)) {
                } else if (matches(opt, "-force") == 0) {
                        ++force;
                } else if (matches(opt, "-json") == 0) {
@@ -200,8 +199,7 @@ main(int argc, char **argv)
 
        _SL_ = oneline ? "\\" : "\n";
 
-       if (color && !json)
-               enable_color();
+       check_enable_color(color, json);
 
        if (batch_file)
                return batch(batch_file);
@@ -209,6 +207,8 @@ main(int argc, char **argv)
        if (rtnl_open(&rth, 0) < 0)
                exit(1);
 
+       rtnl_set_strict_dump(&rth);
+
        if (argc > 1)
                return do_cmd(argv[1], argc-1, argv+1);