+/* SPDX-License-Identifier: GPL-2.0 */
/*
* Get/set/delete bridge with netlink
*
#include "utils.h"
#include "br_common.h"
#include "namespace.h"
+#include "color.h"
struct rtnl_handle rth = { .fd = -1 };
int preferred_family = AF_UNSPEC;
int oneline;
int show_stats;
int show_details;
+int show_pretty;
+int color;
int compress_vlans;
-int json_output;
+int json;
int timestamp;
char *batch_file;
int force;
-const char *_SL_;
static void usage(void) __attribute__((noreturn));
"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] -j{son} }\n");
+" -c[ompressvlans] -color -p[retty] -j[son] }\n");
exit(-1);
}
NEXT_ARG();
if (netns_switch(argv[1]))
exit(-1);
+ } else if (matches_color(opt, &color)) {
} else if (matches(opt, "-compressvlans") == 0) {
++compress_vlans;
} else if (matches(opt, "-force") == 0) {
++force;
} else if (matches(opt, "-json") == 0) {
- ++json_output;
+ ++json;
+ } else if (matches(opt, "-pretty") == 0) {
+ ++pretty;
} else if (matches(opt, "-batch") == 0) {
argc--;
argv++;
_SL_ = oneline ? "\\" : "\n";
+ check_enable_color(color, json);
+
if (batch_file)
return batch(batch_file);