diff --git a/include/json_print.h b/include/json_print.h index 45a817ce..2ca7830a 100644 --- a/include/json_print.h +++ b/include/json_print.h @@ -15,8 +15,6 @@ #include "json_writer.h" #include "color.h" -extern int show_pretty; - json_writer_t *get_json_writer(void); /* diff --git a/ip/ip.c b/ip/ip.c index 233a9d77..f6248846 100644 --- a/ip/ip.c +++ b/ip/ip.c @@ -31,7 +31,6 @@ int show_stats; int show_details; int oneline; int brief; -int show_pretty; int json; int timestamp; const char *_SL_; @@ -261,7 +260,7 @@ int main(int argc, char **argv) } else if (matches(opt, "-json") == 0) { ++json; } else if (matches(opt, "-pretty") == 0) { - ++show_pretty; + ++pretty; } else if (matches(opt, "-rcvbuf") == 0) { unsigned int size; diff --git a/lib/json_print.c b/lib/json_print.c index b507b14b..bda72933 100644 --- a/lib/json_print.c +++ b/lib/json_print.c @@ -28,7 +28,7 @@ void new_json_obj(int json) perror("json object"); exit(1); } - if (show_pretty) + if (pretty) jsonw_pretty(_jw, true); jsonw_start_array(_jw); } diff --git a/lib/utils.c b/lib/utils.c index d86c2eec..cbe5d8de 100644 --- a/lib/utils.c +++ b/lib/utils.c @@ -37,6 +37,7 @@ int resolve_hosts; int timestamp_short; +int pretty; int read_prop(const char *dev, char *prop, long *value) { diff --git a/misc/ifstat.c b/misc/ifstat.c index ac3eff6b..50b906e8 100644 --- a/misc/ifstat.c +++ b/misc/ifstat.c @@ -45,7 +45,6 @@ int no_update; int scan_interval; int time_constant; int show_errors; -int pretty; double W; char **patterns; int npatterns; diff --git a/misc/nstat.c b/misc/nstat.c index a4dd405d..ffa14b1e 100644 --- a/misc/nstat.c +++ b/misc/nstat.c @@ -37,7 +37,6 @@ int reset_history; int ignore_history; int no_output; int json_output; -int pretty; int no_update; int scan_interval; int time_constant; diff --git a/tc/f_u32.c b/tc/f_u32.c index 019d56c6..b6064cdb 100644 --- a/tc/f_u32.c +++ b/tc/f_u32.c @@ -25,8 +25,6 @@ #include "utils.h" #include "tc_util.h" -extern int show_pretty; - static void explain(void) { fprintf(stderr, @@ -965,7 +963,7 @@ static void show_keys(FILE *f, const struct tc_u32_key *key) { int i = 0; - if (!show_pretty) + if (!pretty) goto show_k; for (i = 0; i < ARRAY_SIZE(u32_pprinters); i++) { diff --git a/tc/tc.c b/tc/tc.c index aba5c101..cfccf875 100644 --- a/tc/tc.c +++ b/tc/tc.c @@ -33,7 +33,6 @@ int show_stats; int show_details; int show_raw; -int show_pretty; int show_graph; int timestamp; @@ -42,7 +41,6 @@ int use_iec; int force; bool use_names; int json; -int pretty; static char *conf_file; @@ -449,7 +447,7 @@ int main(int argc, char **argv) } else if (matches(argv[1], "-raw") == 0) { ++show_raw; } else if (matches(argv[1], "-pretty") == 0) { - ++show_pretty; + ++pretty; } else if (matches(argv[1], "-graph") == 0) { show_graph = 1; } else if (matches(argv[1], "-Version") == 0) { @@ -485,8 +483,6 @@ int main(int argc, char **argv) ++timestamp_short; } else if (matches(argv[1], "-json") == 0) { ++json; - } else if (matches(argv[1], "-pretty") == 0) { - ++pretty; } else { fprintf(stderr, "Option \"%s\" is unknown, try \"tc -help\".\n", argv[1]); return -1;