]> 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 03:41:22 +0000 (22:41 -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 c962a2d9408792ae81aad698bd399b2533561d5f..5e66d634afc2eb1ec3ddf2c7ba7e2b93da013727 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 062d1ef409d3fadd9ef82fa37c1ced76031c88cc..034f43d5b518992b6bd1e9dc139b8c33eceeaa34 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,