\fB[ \fB-n\fR[\fIetns\fR] name \fB] \fR|
\fB[ \fB-nm \fR| \fB-nam\fR[\fIes\fR] \fB] \fR|
\fB[ \fR{ \fB-cf \fR| \fB-c\fR[\fIonf\fR] \fR} \fB[ filename ] \fB] \fR
-\fB[ -t\fR[imestamp\fR] \fB\] \fR| \fB[ -t\fR[short\fR] \fB]\fR }
+\fB[ -t\fR[imestamp\fR] \fB\] \fR| \fB[ -t\fR[short\fR] \fR| \fB[
+-o\fR[neline\fR] \fB]\fR }
.ti 8
.IR FORMAT " := {"
don't terminate tc on errors in batch mode.
If there were any errors during execution of the commands, the application return code will be non zero.
+.TP
+.BR "\-o" , " \-oneline"
+output each record on a single line, replacing line feeds
+with the
+.B '\e'
+character. This is convenient when you want to count records
+with
+.BR wc (1)
+or to
+.BR grep (1)
+the output.
+
.TP
.BR "\-n" , " \-net" , " \-netns " <NETNS>
switches
bool use_names;
int json;
int color;
+int oneline;
+const char *_SL_;
static char *conf_file;
"where OBJECT := { qdisc | class | filter | action | monitor | exec }\n"
" OPTIONS := { -s[tatistics] | -d[etails] | -r[aw] | -b[atch] [filename] | -n[etns] name |\n"
" -nm | -nam[es] | { -cf | -conf } path } |\n"
- " -j[son] -p[retty] -c[olor]\n");
+ " -o[neline] -j[son] -p[retty] -c[olor]\n");
}
static int do_cmd(int argc, char **argv, void *buf, size_t buflen)
++timestamp_short;
} else if (matches(argv[1], "-json") == 0) {
++json;
+ } else if (matches(argv[1], "-oneline") == 0) {
+ ++oneline;
} else {
fprintf(stderr, "Option \"%s\" is unknown, try \"tc -help\".\n", argv[1]);
return -1;
argc--; argv++;
}
+ _SL_ = oneline ? "\\" : "\n";
+
if (color & !json)
enable_color();