summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLouis Burda <quent.burda@gmail.com>2023-06-02 18:40:07 +0200
committerLouis Burda <quent.burda@gmail.com>2023-06-02 18:40:07 +0200
commit127b061df0f4d1cedc356ec9fc0b031b9403e96b (patch)
treedeecfe148f606efbaaa99d0354fd9033ab14b580
parent2b1d383ba24ec257bb19667918919d9348e21c71 (diff)
downloadtabular-127b061df0f4d1cedc356ec9fc0b031b9403e96b.tar.gz
tabular-127b061df0f4d1cedc356ec9fc0b031b9403e96b.zip
Add flag for cfg.colors
-rw-r--r--main.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/main.c b/main.c
index a2cf01b..21dd228 100644
--- a/main.c
+++ b/main.c
@@ -275,6 +275,11 @@ parse(int argc, const char **argv)
} else if (!strcmp(*arg, "--skip-empty-lines")) {
if (!*++arg) die("missing args");
skip_empty_lines = bool_arg(*arg, arg[-1]);
+ if (!*++arg) die("missing args");
+ } else if (!strcmp(*arg, "--colors")) {
+ if (!*++arg) die("missing args");
+ cfg.colors = (int) strtol(*arg, &end, 10);
+ if (end && *end) die("bad %s", arg[-1]);
} else {
*dst++ = *arg;
}