]> Kevux Git Server - fll/commitdiff
Cleanup: Conditionally print color based on verbosity mode in certain messages in...
authorKevin Day <thekevinday@gmail.com>
Tue, 9 Jun 2020 03:41:59 +0000 (22:41 -0500)
committerKevin Day <thekevinday@gmail.com>
Tue, 9 Jun 2020 03:41:59 +0000 (22:41 -0500)
level_3/fake/c/fake.c
level_3/fake/c/fake.h
level_3/fake/c/private-build.c
level_3/fake/c/private-clean.c
level_3/fake/c/private-skeleton.c

index 1134c781627007b80f7e224a1cbd9a4742f8aadd..d4277655bad05d01bb88874217a9b3e89c4755c7 100644 (file)
@@ -127,6 +127,9 @@ extern "C" {
         }
         else if (choice == fake_parameter_verbose) {
           data->verbosity = fake_verbosity_verbose;
+
+          data->color_section_set = data->context.important;
+          data->color_section_reset = data->context.reset;
         }
         else if (choice == fake_parameter_debug) {
           data->verbosity = fake_verbosity_debug;
index 9bf9e32678bc9d48795e76387810dd2f2b272b35..873279ff6dfad5ee8150b7f3e584313d79c1aeb8 100644 (file)
@@ -370,6 +370,9 @@ extern "C" {
     uint8_t operation;
     uint8_t verbosity;
 
+    f_string_static color_section_set;
+    f_string_static color_section_reset;
+
     f_string_dynamics define;
     f_string_dynamics mode;
     f_string_dynamic process;
@@ -431,6 +434,8 @@ extern "C" {
       0, \
       0, \
       fake_verbosity_normal, \
+      f_string_static_initialize, \
+      f_string_static_initialize, \
       f_string_dynamics_initialize, \
       f_string_dynamics_initialize, \
       f_string_dynamic_initialize, \
index a913506f3bc7fb50093033b460310a3f51acb65f..a3ffd1e151f5aa098ca10af01a9bd08456eeaa53 100644 (file)
@@ -199,7 +199,7 @@ extern "C" {
 
     if (data.verbosity != fake_verbosity_quiet) {
       printf("%c", f_string_eol[0]);
-      fl_color_print_line(f_type_output, data.context.important, data.context.reset, "Copying %s.", label);
+      fl_color_print_line(f_type_output, data.color_section_set, data.color_section_reset, "Copying %s.", label);
     }
 
     f_macro_string_dynamic_new(*status, path_source, source.used);
@@ -386,7 +386,7 @@ extern "C" {
 
     if (data.verbosity != fake_verbosity_quiet) {
       printf("%c", f_string_eol[0]);
-      fl_color_print_line(f_type_output, data.context.important, data.context.reset, "Creating base build directories.");
+      fl_color_print_line(f_type_output, data.color_section_set, data.color_section_reset, "Creating base build directories.");
     }
 
     for (uint8_t i = 0; i < 15; i++) {
@@ -667,7 +667,7 @@ extern "C" {
 
     if (data.verbosity != fake_verbosity_quiet) {
       printf("%c", f_string_eol[0]);
-      fl_color_print_line(f_type_output, data.context.important, data.context.reset, "Compiling shared library.");
+      fl_color_print_line(f_type_output, data.color_section_set, data.color_section_reset, "Compiling shared library.");
     }
 
     f_string_dynamics arguments = f_string_dynamics_initialize;
@@ -931,7 +931,7 @@ extern "C" {
 
     if (data.verbosity != fake_verbosity_quiet) {
       printf("%c", f_string_eol[0]);
-      fl_color_print_line(f_type_output, data.context.important, data.context.reset, "Compiling static library.");
+      fl_color_print_line(f_type_output, data.color_section_set, data.color_section_reset, "Compiling static library.");
     }
 
     f_string_dynamic file_name = f_string_dynamic_initialize;
@@ -2137,7 +2137,7 @@ extern "C" {
 
     if (data.verbosity != fake_verbosity_quiet) {
       printf("%c", f_string_eol[0]);
-      fl_color_print_line(f_type_output, data.context.important, data.context.reset, "Compiling static objects.");
+      fl_color_print_line(f_type_output, data.color_section_set, data.color_section_reset, "Compiling static objects.");
     }
 
     f_string_dynamic file_name = f_string_dynamic_initialize;
@@ -2307,7 +2307,7 @@ extern "C" {
   f_return_status fake_build_operate(const fake_data data) {
     if (data.verbosity != fake_verbosity_quiet) {
       printf("%c", f_string_eol[0]);
-      fl_color_print_line(f_type_output, data.context.important, data.context.reset, "Building project.");
+      fl_color_print_line(f_type_output, data.color_section_set, data.color_section_reset, "Building project.");
     }
 
     f_status status = F_none;
@@ -2420,7 +2420,7 @@ extern "C" {
 
     if (data.verbosity != fake_verbosity_quiet) {
       printf("%c", f_string_eol[0]);
-      fl_color_print_line(f_type_output, data.context.important, data.context.reset, "Compiling shared program.");
+      fl_color_print_line(f_type_output, data.color_section_set, data.color_section_reset, "Compiling shared program.");
     }
 
     f_string_dynamics arguments = f_string_dynamics_initialize;
@@ -2512,7 +2512,7 @@ extern "C" {
 
     if (data.verbosity != fake_verbosity_quiet) {
       printf("%c", f_string_eol[0]);
-      fl_color_print_line(f_type_output, data.context.important, data.context.reset, "Compiling static program.");
+      fl_color_print_line(f_type_output, data.color_section_set, data.color_section_reset, "Compiling static program.");
     }
 
     f_string_dynamics arguments = f_string_dynamics_initialize;
index de14814969f1a986de39195b5a93e3cf206f8eb6..a369658f9e43178d008b5880785d552829c60316 100644 (file)
@@ -13,9 +13,9 @@ extern "C" {
 
     if (data.verbosity != fake_verbosity_quiet) {
       printf("%c", f_string_eol[0]);
-      fl_color_print(f_type_output, data.context.important, data.context.reset, "Deleting all files within build directory '");
+      fl_color_print(f_type_output, data.color_section_set, data.color_section_reset, "Deleting all files within build directory '");
       fl_color_print(f_type_output, data.context.notable, data.context.reset, "%s", data.path_build.string);
-      fl_color_print_line(f_type_output, data.context.important, data.context.reset, "'.");
+      fl_color_print_line(f_type_output, data.color_section_set, data.color_section_reset, "'.");
     }
 
     if (data.verbosity == fake_verbosity_verbose) {
index ad6cf1d2361e7afe4e17aa1998fb96f3074e7508..11ba07e124a1979bf539128b9a3fbe29f4f759de 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
 
     if (data.verbosity != fake_verbosity_quiet) {
       printf("%c", f_string_eol[0]);
-      fl_color_print_line(f_type_output, data.context.important, data.context.reset, "Generating skeleton structure.");
+      fl_color_print_line(f_type_output, data.color_section_set, data.color_section_reset, "Generating skeleton structure.");
     }
 
     {