\fB\-d\fP, \fB\-\-debug\fP
Debug mode brief output.
.TP
-\fB\-n\fP, \fB\-\-no\-color\fP
-Removes changes coloring.
-.TP
\fB\-z\fP, \fB\-\-zone\-list\fP
Instead of reading the journal, display the list of zones in the DB.
(\fIzone_name\fP not needed)
\fB\-c\fP, \fB\-\-check\fP
Enable additional journal semantic checks during printing.
.TP
+\fB\-x\fP, \fB\-\-mono\fP
+Don\(aqt generate colorized output.
+.TP
+\fB\-n\fP, \fB\-\-no\-color\fP
+An alias for \fB\-x\fP\&. Use of this option is deprecated, it will be removed in the future.
+.TP
+\fB\-X\fP, \fB\-\-color\fP
+Force colorized output.
+.TP
\fB\-h\fP, \fB\-\-help\fP
Print the program help.
.TP
#include <getopt.h>
#include <stdlib.h>
#include <sys/stat.h>
+#include <unistd.h>
#include "libknot/libknot.h"
#include "knot/journal/journal_basic.h"
"Parameters:\n"
" -l, --limit <num> Read only <num> newest changes.\n"
" -s, --serial <soa> Start with a specific SOA serial.\n"
- " -n, --no-color Get output without terminal coloring.\n"
" -z, --zone-list Instead of reading the journal, display the list\n"
" of zones in the DB (<zone_name> not needed).\n"
" -c, --check Additional journal semantic checks.\n"
" -d, --debug Debug mode output.\n"
+ " -x, --mono Get output without coloring.\n"
+ " -n, --no-color An alias for -x, deprecated.\n"
+ " -X, --color Force output coloring.\n"
" -h, --help Print the program help.\n"
" -V, --version Print the program version.\n",
PROGRAM_NAME);
print_params_t params = {
.debug = false,
- .color = true,
+ .color = isatty(STDOUT_FILENO),
.check = false,
.limit = -1,
.from_serial = false,
struct option opts[] = {
{ "limit", required_argument, NULL, 'l' },
{ "serial", required_argument, NULL, 's' },
- { "no-color", no_argument, NULL, 'n' },
{ "zone-list", no_argument, NULL, 'z' },
{ "check", no_argument, NULL, 'c' },
{ "debug", no_argument, NULL, 'd' },
+ { "mono", no_argument, NULL, 'x' },
+ { "no-color", no_argument, NULL, 'n' },
+ { "color", no_argument, NULL, 'X' },
{ "help", no_argument, NULL, 'h' },
{ "version", no_argument, NULL, 'V' },
{ NULL }
};
int opt = 0;
- while ((opt = getopt_long(argc, argv, "l:s:nzcdhV", opts, NULL)) != -1) {
+ while ((opt = getopt_long(argc, argv, "l:s:zcdxnXhV", opts, NULL)) != -1) {
switch (opt) {
case 'l':
if (str_to_int(optarg, ¶ms.limit, 0, INT_MAX) != KNOT_EOK) {
}
params.from_serial = true;
break;
- case 'n':
- params.color = false;
- break;
case 'z':
justlist = true;
break;
case 'd':
params.debug = true;
break;
+ case 'n':
+ case 'x':
+ params.color = false;
+ break;
+ case 'X':
+ params.color = true;
+ break;
case 'h':
print_help();
return EXIT_SUCCESS;