From 0efb3c61a9575eede8984f362dfa6cd0b7562f4a Mon Sep 17 00:00:00 2001 From: Phil Jones Date: Tue, 6 Dec 2022 11:51:41 +0000 Subject: Add config file unit tests and fix some bugs. --- src/main.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index cde56b4..0c5c6cb 100644 --- a/src/main.c +++ b/src/main.c @@ -935,14 +935,18 @@ static void parse_args(struct tofi *tofi, int argc, char *argv[]) opt = getopt_long(argc, argv, short_options, long_options, &option_index); while (opt != -1) { if (opt == 0) { - config_apply(tofi, long_options[option_index].name, optarg); + if (!config_apply(tofi, long_options[option_index].name, optarg)) { + exit(EXIT_FAILURE); + } } else if (opt == 'k') { /* * Backwards compatibility for --late-keyboard-init not * taking an argument. */ if (optarg) { - config_apply(tofi, long_options[option_index].name, optarg); + if (!config_apply(tofi, long_options[option_index].name, optarg)) { + exit(EXIT_FAILURE); + } } else { tofi->late_keyboard_init = true; } -- cgit v1.2.3