summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2020-05-06 23:18:54 +0200
committerThomas Haller <thaller@redhat.com>2020-05-07 13:58:09 +0200
commit3a1273f777133d5be745950dce4555c2adb664f0 (patch)
treeed50d36a71612fdf8063e524660c2adcdfd22b7d
parentb93e12cb43b6401ac3a891fe8841f08eddbf6b1d (diff)
downloadNetworkManager-3a1273f777133d5be745950dce4555c2adb664f0.tar.gz
cli: avoid empty if block without a comment
lgtm.com flags this as "Empty block without comment". Avoid it. This code is of course ugly. Much work was already done to port such occurrences, and more is needed. I won't add a FIXME comment, because lgtm.com flags those too. :)
-rw-r--r--clients/cli/connections.c3
-rw-r--r--clients/cli/devices.c4
-rw-r--r--clients/cli/general.c4
3 files changed, 11 insertions, 0 deletions
diff --git a/clients/cli/connections.c b/clients/cli/connections.c
index 65cc1e905e..e6d6c69905 100644
--- a/clients/cli/connections.c
+++ b/clients/cli/connections.c
@@ -1451,7 +1451,9 @@ nmc_active_connection_details (NMActiveConnection *acon, NmCli *nmc)
gboolean was_output = FALSE;
if (!nmc->required_fields || g_ascii_strcasecmp (nmc->required_fields, "common") == 0) {
+ /* pass */
} else if (!nmc->required_fields || g_ascii_strcasecmp (nmc->required_fields, "all") == 0) {
+ /* pass */
} else
fields_str = nmc->required_fields;
@@ -2076,6 +2078,7 @@ do_connections_show (const NMCCommand *cmd, NmCli *nmc, int argc, const char *co
if (!nmc->required_fields || g_ascii_strcasecmp (nmc->required_fields, "common") == 0)
fields_str = NMC_FIELDS_CON_SHOW_COMMON;
else if (!nmc->required_fields || g_ascii_strcasecmp (nmc->required_fields, "all") == 0) {
+ /* pass */
} else
fields_str = nmc->required_fields;
diff --git a/clients/cli/devices.c b/clients/cli/devices.c
index 7031b43756..2d79d2ae9a 100644
--- a/clients/cli/devices.c
+++ b/clients/cli/devices.c
@@ -1436,6 +1436,7 @@ show_device_info (NMDevice *device, NmCli *nmc)
if (!nmc->required_fields || g_ascii_strcasecmp (nmc->required_fields, "common") == 0)
fields_str = NMC_FIELDS_DEV_SHOW_SECTIONS_COMMON;
else if (g_ascii_strcasecmp (nmc->required_fields, "all") == 0) {
+ /* pass */
} else
fields_str = nmc->required_fields;
@@ -1749,6 +1750,7 @@ do_devices_status (const NMCCommand *cmd, NmCli *nmc, int argc, const char *cons
if (!nmc->required_fields || g_ascii_strcasecmp (nmc->required_fields, "common") == 0)
fields_str = "DEVICE,TYPE,STATE,CONNECTION";
else if (!nmc->required_fields || g_ascii_strcasecmp (nmc->required_fields, "all") == 0) {
+ /* pass */
} else
fields_str = nmc->required_fields;
@@ -3149,6 +3151,7 @@ do_device_wifi_list (const NMCCommand *cmd, NmCli *nmc, int argc, const char *co
if (!nmc->required_fields || g_ascii_strcasecmp (nmc->required_fields, "common") == 0)
fields_str = NMC_FIELDS_DEV_WIFI_LIST_COMMON;
else if (!nmc->required_fields || g_ascii_strcasecmp (nmc->required_fields, "all") == 0) {
+ /* pass */
} else
fields_str = nmc->required_fields;
@@ -4651,6 +4654,7 @@ do_device_lldp_list (const NMCCommand *cmd, NmCli *nmc, int argc, const char *co
if (!nmc->required_fields || g_ascii_strcasecmp (nmc->required_fields, "common") == 0)
fields_str = NMC_FIELDS_DEV_LLDP_LIST_COMMON;
else if (!nmc->required_fields || g_ascii_strcasecmp (nmc->required_fields, "all") == 0) {
+ /* pass */
} else
fields_str = nmc->required_fields;
diff --git a/clients/cli/general.c b/clients/cli/general.c
index 747203bb06..05ff4dee37 100644
--- a/clients/cli/general.c
+++ b/clients/cli/general.c
@@ -545,7 +545,9 @@ print_permissions (void *user_data)
}
if (!nmc->required_fields || g_ascii_strcasecmp (nmc->required_fields, "common") == 0) {
+ /* pass */
} else if (g_ascii_strcasecmp (nmc->required_fields, "all") == 0) {
+ /* pass */
} else
fields_str = nmc->required_fields;
@@ -694,7 +696,9 @@ show_general_logging (NmCli *nmc)
};
if (!nmc->required_fields || g_ascii_strcasecmp (nmc->required_fields, "common") == 0) {
+ /* pass */
} else if (g_ascii_strcasecmp (nmc->required_fields, "all") == 0) {
+ /* pass */
} else
fields_str = nmc->required_fields;