]> Kevux Git Server - fll/commitdiff
Bugfix: firewall show command operating as lock
authorKevin Day <thekevinday@gmail.com>
Fri, 19 Jul 2019 03:38:41 +0000 (22:38 -0500)
committerKevin Day <thekevinday@gmail.com>
Fri, 19 Jul 2019 04:09:19 +0000 (23:09 -0500)
The debug parameters is conditionally enabled/disabled but the enum is not.
Make the enum conditionally enable/disable the debug option to prevent the wrong id from being used when debug is disabled.

Fix the alignment of the debug message.

Conditionally enable/disable displaying the debug in the help.

level_3/firewall/c/firewall.c
level_3/firewall/c/firewall.h

index 8bd26e7a6df6e1b993b867201869a7a55ea44310..cab0d10d2246213c34ee19f485f2b7a7103c2395 100644 (file)
@@ -59,12 +59,14 @@ extern "C" {
     fl_print_color(f_standard_output, data.context.standout, data.context.reset, f_console_standard_long_version);
     printf("   Print only the version number");
 
-    printf("\n  %s", f_console_symbol_short_disable);
-    fl_print_color(f_standard_output, data.context.standout, data.context.reset, f_console_standard_short_debug);
-
-    printf(", %s", f_console_symbol_long_disable);
-    fl_print_color(f_standard_output, data.context.standout, data.context.reset, f_console_standard_long_debug);
-    printf("   Enable debugging");
+    #ifdef _en_firewall_debug_
+      printf("\n  %s", f_console_symbol_short_disable);
+      fl_print_color(f_standard_output, data.context.standout, data.context.reset, f_console_standard_short_debug);
+
+      printf(", %s", f_console_symbol_long_disable);
+      fl_print_color(f_standard_output, data.context.standout, data.context.reset, f_console_standard_long_debug);
+      printf("     Enable debugging");
+    #endif // _en_firewall_debug_
 
     printf("\n\n");
     fl_print_color(f_standard_output, data.context.important, data.context.reset, " Available Commands: ");
index 8d3f3ed09f90df353742d60c1ec3cc06f6060703..c4b152dd22133705cd3d882604030b779cb2bf49 100644 (file)
@@ -212,7 +212,11 @@ extern "C" {
     firewall_parameter_light,
     firewall_parameter_no_color,
     firewall_parameter_version,
-    firewall_parameter_debug,
+
+    #ifdef _en_firewall_debug_
+      firewall_parameter_debug,
+    #endif // _en_firewall_debug_
+
     firewall_parameter_command_start,
     firewall_parameter_command_stop,
     firewall_parameter_command_restart,