diff options
author | Phil Jones <philj56@gmail.com> | 2022-12-06 11:51:41 +0000 |
---|---|---|
committer | Phil Jones <philj56@gmail.com> | 2022-12-06 11:51:41 +0000 |
commit | 0efb3c61a9575eede8984f362dfa6cd0b7562f4a (patch) | |
tree | 9dd96f4b9c4382886c3981a8c7ca222966d0c571 /src/main.c | |
parent | 4e06e2e09c5473f6aac630373a7bfe47e6258464 (diff) |
Add config file unit tests and fix some bugs.
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -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; } |