]> Kevux Git Server - fll/commitdiff
Bugfix: The iki_read program is not handling verbosity correctly.
authorKevin Day <thekevinday@gmail.com>
Mon, 16 May 2022 00:25:15 +0000 (19:25 -0500)
committerKevin Day <thekevinday@gmail.com>
Mon, 16 May 2022 00:25:15 +0000 (19:25 -0500)
The newline should be printed at the end of the program unless in quiet mode.
This fails for two reasons:
1) The conditional checks before printing are wrong.
2) The quiet parameter is at the wrong position resulting in it being mixed up with the "no color" parameter.

level_3/iki_read/c/common.h
level_3/iki_read/c/iki_read.c

index 6a01ff5614e10edaea0b283122d864f4869444e2..0a9a5614186c75cfd2a9993caf53cb5741668421 100644 (file)
@@ -178,8 +178,8 @@ extern "C" {
       macro_f_console_parameter_t_initialize(f_console_standard_short_help_s.string, f_console_standard_long_help_s.string, 0, 0, f_console_type_normal_e), \
       macro_f_console_parameter_t_initialize(f_console_standard_short_light_s.string, f_console_standard_long_light_s.string, 0, 0, f_console_type_inverse_e), \
       macro_f_console_parameter_t_initialize(f_console_standard_short_dark_s.string, f_console_standard_long_dark_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_quiet_s.string, f_console_standard_long_quiet_s.string, 0, 0, f_console_type_inverse_e), \
       macro_f_console_parameter_t_initialize(f_console_standard_short_no_color_s.string, f_console_standard_long_no_color_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_quiet_s.string, f_console_standard_long_quiet_s.string, 0, 0, f_console_type_inverse_e), \
       macro_f_console_parameter_t_initialize(f_console_standard_short_normal_s.string, f_console_standard_long_normal_s.string, 0, 0, f_console_type_inverse_e), \
       macro_f_console_parameter_t_initialize(f_console_standard_short_verbose_s.string, f_console_standard_long_verbose_s.string, 0, 0, f_console_type_inverse_e), \
       macro_f_console_parameter_t_initialize(f_console_standard_short_debug_s.string, f_console_standard_long_debug_s.string, 0, 0, f_console_type_inverse_e), \
index 1b2d7543499657754f7da178aa6d9a1e476c6376..81b84fd9513edd794a00e7fa881ac0e92b588ff7 100644 (file)
@@ -533,14 +533,12 @@ extern "C" {
     }
 
     // Ensure a new line is always put at the end of the program execution, unless in quiet mode.
-    if (main->error.verbosity != f_console_verbosity_quiet_e) {
-      if (F_status_is_error(status) || !data.mode) {
-        if (F_status_set_fine(status) == F_interrupt) {
-          fflush(main->output.to.stream);
-        }
-
-        fll_print_dynamic_raw(f_string_eol_s, main->output.to.stream);
+    if (main->output.verbosity != f_console_verbosity_quiet_e) {
+      if (F_status_set_fine(status) == F_interrupt) {
+        fflush(main->output.to.stream);
       }
+
+      fll_print_dynamic_raw(f_string_eol_s, main->output.to.stream);
     }
 
     iki_read_data_delete(&data);