From 7d7af62d84b6fd1fc693b7ae9abb5b780c47e7fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Thu, 18 Jul 2019 14:34:45 +0200 Subject: [PATCH] main: allow TERM to be set on the command line --- main.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/main.c b/main.c index 70ca3d48..da862742 100644 --- a/main.c +++ b/main.c @@ -278,6 +278,7 @@ main(int argc, char *const *argv) return ret; static const struct option longopts[] = { + {"term", required_argument, 0, 't'}, {"font", required_argument, 0, 'f'}, {NULL, no_argument, 0, 0}, }; @@ -285,11 +286,16 @@ main(int argc, char *const *argv) //const char *font_name = "monospace"; while (true) { - int c = getopt_long(argc, argv, ":f:h", longopts, NULL); + int c = getopt_long(argc, argv, ":t:f:h", longopts, NULL); if (c == -1) break; switch (c) { + case 't': + free(conf.term); + conf.term = strdup(optarg); + break; + case 'f': free(conf.font); conf.font = strdup(optarg);