about summary refs log tree commit diff
path: root/clients
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2017-05-11 14:55:55 +0200
committerMichael Biebl <biebl@debian.org>2017-05-11 14:55:55 +0200
commitc333f062ddcba9b35330647bf6cbd0a07f2d786e (patch)
tree257c3a0c74c09f4ad2328eab5b932806405f0c1c /clients
parenta222e56e103f949b148a6942e385ccca2c26d9f3 (diff)
New upstream version 1.8.0 upstream/1.8.0
Diffstat (limited to 'clients')
-rw-r--r--clients/cli/agent.c4
-rw-r--r--clients/cli/common.c131
-rw-r--r--clients/cli/common.h2
-rw-r--r--clients/cli/connections.c673
-rw-r--r--clients/cli/devices.c184
-rw-r--r--clients/cli/general.c116
-rw-r--r--clients/cli/nmcli-completion1297
-rw-r--r--clients/cli/nmcli.c144
-rw-r--r--clients/cli/nmcli.h4
-rw-r--r--clients/cli/settings-docs.c33
-rw-r--r--clients/cli/settings.c1099
-rw-r--r--clients/cli/settings.h1
-rw-r--r--clients/cli/utils.c355
-rw-r--r--clients/cli/utils.h5
-rw-r--r--clients/common/nm-secret-agent-simple.h4
-rw-r--r--clients/common/nm-vpn-helpers.h2
-rw-r--r--clients/tui/nm-editor-bindings.h2
-rw-r--r--clients/tui/nm-editor-utils.c40
-rw-r--r--clients/tui/nm-editor-utils.h2
-rw-r--r--clients/tui/nmt-device-entry.h2
-rw-r--r--clients/tui/nmt-edit-connection-list.c27
-rw-r--r--clients/tui/nmt-edit-connection-list.h4
-rw-r--r--clients/tui/nmt-editor-page.c17
-rw-r--r--clients/tui/nmt-editor-page.h5
-rw-r--r--clients/tui/nmt-editor.c12
-rw-r--r--clients/tui/nmt-editor.h2
-rw-r--r--clients/tui/nmt-page-bond.c10
-rw-r--r--clients/tui/nmt-page-bridge.c18
-rw-r--r--clients/tui/nmt-page-team.c10
-rw-r--r--clients/tui/nmt-route-editor.h2
-rw-r--r--clients/tui/nmtui.h2
31 files changed, 1885 insertions, 2324 deletions
diff --git a/clients/cli/agent.c b/clients/cli/agent.c
index 4cbf7d2d..23582f49 100644
--- a/clients/cli/agent.c
+++ b/clients/cli/agent.c
@@ -139,6 +139,7 @@ secrets_requested (NMSecretAgentSimple *agent,
 static NMCResultCode
 do_agent_secret (NmCli *nmc, int argc, char **argv)
 {
+	next_arg (nmc, &argc, &argv, NULL);
 	if (nmc->complete)
 		return nmc->return_value;
 
@@ -167,6 +168,7 @@ do_agent_polkit (NmCli *nmc, int argc, char **argv)
 {
 	GError *error = NULL;
 
+	next_arg (nmc, &argc, &argv, NULL);
 	if (nmc->complete)
 		return nmc->return_value;
 
@@ -192,6 +194,7 @@ do_agent_all (NmCli *nmc, int argc, char **argv)
 {
 	NMCResultCode secret_res;
 
+	next_arg (nmc, &argc, &argv, NULL);
 	if (nmc->complete)
 		return nmc->return_value;
 
@@ -218,6 +221,7 @@ static const NMCCommand agent_cmds[] = {
 NMCResultCode
 do_agent (NmCli *nmc, int argc, char **argv)
 {
+	next_arg (nmc, &argc, &argv, NULL);
 	nmc_do_cmd (nmc, agent_cmds, *argv, argc, argv);
 
 	return nmc->return_value;
diff --git a/clients/cli/common.c b/clients/cli/common.c
index 47e858e7..4d89c3f8 100644
--- a/clients/cli/common.c
+++ b/clients/cli/common.c
@@ -395,26 +395,20 @@ finish:
 /*
  * nmc_parse_and_build_route:
  * @family: AF_INET or AF_INET6
- * @first: the route destination in the form of "address/prefix"
-     (/prefix is optional)
- * @second: (allow-none): next hop address, if third is not NULL. Otherwise it could be
-     either next hop address or metric. (It can be NULL when @third is NULL).
- * @third: (allow-none): route metric
+ * @str: route string to be parsed
  * @error: location to store GError
  *
- * Parse route from strings and return an #NMIPRoute
+ * Parse route from string and return an #NMIPRoute
  *
- * Returns: %TRUE on success, %FALSE on failure
+ * Returns: a new #NMIPRoute or %NULL on error
  */
 NMIPRoute *
 nmc_parse_and_build_route (int family,
-                           const char *first,
-                           const char *second,
-                           const char *third,
+                           const char *str,
                            GError **error)
 {
 	int max_prefix = (family == AF_INET) ? 32 : 128;
-	char *dest = NULL, *plen = NULL;
+	char *plen = NULL;
 	const char *next_hop = NULL;
 	const char *canon_dest;
 	long int prefix = max_prefix;
@@ -423,13 +417,28 @@ nmc_parse_and_build_route (int family,
 	gboolean success = FALSE;
 	GError *local = NULL;
 	gint64 metric = -1;
+	guint i, len;
+	gs_strfreev char **routev = NULL;
+	gs_free char *value = NULL;
+	gs_free char *dest = NULL;
+	gs_unref_hashtable GHashTable *attrs = NULL;
+	GHashTable *tmp_attrs;
+	const char *syntax = _("The valid syntax is: 'ip[/prefix] [next-hop] [metric] [attribute=val]... [,ip[/prefix] ...]'");
 
 	g_return_val_if_fail (family == AF_INET || family == AF_INET6, FALSE);
-	g_return_val_if_fail (first != NULL, FALSE);
-	g_return_val_if_fail (second || !third, FALSE);
+	g_return_val_if_fail (str, FALSE);
 	g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
 
-	dest = g_strdup (first);
+	value = g_strdup (str);
+	routev = nmc_strsplit_set (g_strstrip (value), " \t", 0);
+	len = g_strv_length (routev);
+	if (len < 1) {
+		g_set_error (error, 1, 0, "%s", syntax);
+		g_prefix_error (error, "'%s' is not valid. ", str);
+		goto finish;
+	}
+
+	dest = g_strdup (routev[0]);
 	plen = strchr (dest, '/');  /* prefix delimiter */
 	if (plen)
 		*plen++ = '\0';
@@ -443,32 +452,56 @@ nmc_parse_and_build_route (int family,
 		}
 	}
 
-	if (second) {
-		if (third || nm_utils_ipaddr_valid (family, second))
-			next_hop = second;
-		else {
-			/* 'second' can be a metric */
-			if (!nmc_string_to_uint (second, TRUE, 0, G_MAXUINT32, &tmp_ulong)) {
-				g_set_error (error, 1, 0, _("the second component of route ('%s') is neither "
-				                            "a next hop address nor a metric"), second);
+	for (i = 1; i < len; i++) {
+		if (nm_utils_ipaddr_valid (family, routev[i])) {
+			if (metric != -1 || attrs) {
+				g_set_error (error, 1, 0, _("the next hop ('%s') must be first"), routev[i]);
+				goto finish;
+			}
+			next_hop = routev[i];
+		} else if (nmc_string_to_uint (routev[i], TRUE, 0, G_MAXUINT32, &tmp_ulong)) {
+			if (attrs) {
+				g_set_error (error, 1, 0, _("the metric ('%s') must be before attributes"), routev[i]);
 				goto finish;
 			}
 			metric = tmp_ulong;
-		}
-	}
+		} else if (strchr (routev[i], '=')) {
+			GHashTableIter iter;
+			char *iter_key;
+			GVariant *iter_value;
+
+			tmp_attrs = nm_utils_parse_variant_attributes (routev[i], ' ', '=', FALSE,
+			                                               nm_ip_route_get_variant_attribute_spec(),
+			                                               error);
+			if (!tmp_attrs) {
+				g_prefix_error (error, "invalid option '%s': ", routev[i]);
+				goto finish;
+			}
+
+			if (!attrs)
+				attrs = g_hash_table_new (g_str_hash, g_str_equal);
 
-	if (third) {
-		if (!nmc_string_to_uint (third, TRUE, 0, G_MAXUINT32, &tmp_ulong)) {
-			g_set_error (error, 1, 0, _("invalid metric '%s'"), third);
+			g_hash_table_iter_init (&iter, tmp_attrs);
+			while (g_hash_table_iter_next (&iter, (gpointer *) &iter_key, (gpointer *) &iter_value)) {
+				if (!nm_ip_route_attribute_validate (iter_key, iter_value, family, NULL, error)) {
+					g_prefix_error (error, "%s: ", iter_key);
+					g_hash_table_unref (tmp_attrs);
+					goto finish;
+				}
+				g_hash_table_insert (attrs, iter_key, iter_value);
+				g_hash_table_iter_steal (&iter);
+			}
+			g_hash_table_unref (tmp_attrs);
+		} else {
+			g_set_error (error, 1, 0, "%s", syntax);
 			goto finish;
 		}
-		metric = tmp_ulong;
 	}
 
 	route = nm_ip_route_new (family, dest, prefix, next_hop, metric, &local);
 	if (!route) {
-		g_set_error (error, NMCLI_ERROR, NMC_RESULT_ERROR_USER_INPUT,
-		             _("invalid route: %s"), local->message);
+		g_set_error (error, 1, 0, "%s", syntax);
+		g_prefix_error (error, _("invalid route: %s. "), local->message);
 		g_clear_error (&local);
 		goto finish;
 	}
@@ -485,10 +518,19 @@ nmc_parse_and_build_route (int family,
 		goto finish;
 	}
 
+	if (attrs) {
+		GHashTableIter iter;
+		char *name;
+		GVariant *variant;
+
+		g_hash_table_iter_init (&iter, attrs);
+		while (g_hash_table_iter_next (&iter, (gpointer *) &name, (gpointer *) &variant))
+			nm_ip_route_set_attribute (route, name, variant);
+	}
+
 	success = TRUE;
 
 finish:
-	g_free (dest);
 	return route;
 }
 
@@ -1253,7 +1295,7 @@ nmc_unique_connection_name (const GPtrArray *connections, const char *try_name)
 	NMConnection *connection;
 	const char *name;
 	char *new_name;
-	unsigned int num = 1;
+	unsigned num = 1;
 	int i = 0;
 
 	new_name = g_strdup (try_name);
@@ -1643,6 +1685,14 @@ call_cmd (NmCli *nmc, GSimpleAsyncResult *simple, const NMCCommand *cmd, int arg
 	}
 }
 
+static void
+nmc_complete_help (const char *prefix)
+{
+	nmc_complete_strings (prefix, "help", NULL);
+	if (*prefix == '-')
+		nmc_complete_strings (prefix, "-help", "--help", NULL);
+}
+
 /**
  * nmc_do_cmd:
  * @nmc: Client instance
@@ -1681,27 +1731,32 @@ nmc_do_cmd (NmCli *nmc, const NMCCommand cmds[], const char *cmd, int argc, char
 
 	if (argc == 1 && nmc->complete) {
 		for (c = cmds; c->cmd; ++c) {
-			if (!*cmd || matches (cmd, c->cmd) == 0)
+			if (!*cmd || matches (cmd, c->cmd))
 				g_print ("%s\n", c->cmd);
 		}
+		nmc_complete_help (cmd);
 		g_simple_async_result_complete_in_idle (simple);
 		g_object_unref (simple);
 		return;
 	}
 
 	for (c = cmds; c->cmd; ++c) {
-		if (cmd && matches (cmd, c->cmd) == 0)
+		if (cmd && matches (cmd, c->cmd))
 			break;
 	}
 
 	if (c->cmd) {
 		/* A valid command was specified. */
+		if (c->usage && argc == 2 && nmc->complete)
+			nmc_complete_help (*(argv+1));
 		if (c->usage && nmc_arg_is_help (*(argv+1))) {
-			c->usage ();
+			if (!nmc->complete)
+				c->usage ();
 			g_simple_async_result_complete_in_idle (simple);
 			g_object_unref (simple);
-		} else
-			call_cmd (nmc, simple, c, argc-1, argv+1);
+		} else {
+			call_cmd (nmc, simple, c, argc, argv);
+		}
 	} else if (cmd) {
 		/* Not a known command. */
 		if (nmc_arg_is_help (cmd) && c->usage) {
@@ -1742,7 +1797,7 @@ nmc_complete_strings (const char *prefix, ...)
 
 	va_start (args, prefix);
 	while ((candidate = va_arg (args, const char *))) {
-		if (!*prefix || matches (prefix, candidate) == 0)
+		if (!*prefix || matches (prefix, candidate))
 			g_print ("%s\n", candidate);
 	}
 	va_end (args);
diff --git a/clients/cli/common.h b/clients/cli/common.h
index 42091363..3a598f63 100644
--- a/clients/cli/common.h
+++ b/clients/cli/common.h
@@ -31,7 +31,7 @@ gboolean print_dhcp4_config (NMDhcpConfig *dhcp4, NmCli *nmc, const char *group_
 gboolean print_dhcp6_config (NMDhcpConfig *dhcp6, NmCli *nmc, const char *group_prefix, const char *one_field);
 
 NMIPAddress *nmc_parse_and_build_address (int family, const char *ip_str, GError **error);
-NMIPRoute *nmc_parse_and_build_route (int family, const char *first, const char *second, const char *third, GError **error);
+NMIPRoute *nmc_parse_and_build_route (int family, const char *str, GError **error);
 
 const char * nmc_device_state_to_string (NMDeviceState state);
 const char * nmc_device_reason_to_string (NMDeviceStateReason reason);
diff --git a/clients/cli/connections.c b/clients/cli/connections.c
index b40d517b..a93dc15f 100644
--- a/clients/cli/connections.c
+++ b/clients/cli/connections.c
@@ -183,6 +183,7 @@ NmcOutputField nmc_fields_settings_names[] = {
 	SETTING_FIELD (NM_SETTING_MACVLAN_SETTING_NAME,           nmc_fields_setting_macvlan + 1),           /* 28 */
 	SETTING_FIELD (NM_SETTING_VXLAN_SETTING_NAME,             nmc_fields_setting_vxlan + 1),             /* 29 */
 	SETTING_FIELD (NM_SETTING_PROXY_SETTING_NAME,             nmc_fields_setting_proxy + 1),             /* 30 */
+	SETTING_FIELD (NM_SETTING_DUMMY_SETTING_NAME,             nmc_fields_setting_dummy + 1),             /* 31 */
 	{NULL, NULL, 0, NULL, NULL, FALSE, FALSE, 0}
 };
 #define NMC_FIELDS_SETTINGS_NAMES_ALL_X  NM_SETTING_CONNECTION_SETTING_NAME","\
@@ -477,6 +478,7 @@ usage_connection_add (void)
 	              "                  [source-port-min <0-65535>]\n"
 	              "                  [source-port-max <0-65535>]\n"
 	              "                  [destination-port <0-65535>]\n\n"
+	              "    dummy:         \n\n"
 	              "  SLAVE_OPTIONS:\n"
 	              "    bridge:       [priority <0-63>]\n"
 	              "                  [path-cost <1-65535>]\n"
@@ -1658,13 +1660,13 @@ parse_preferred_connection_order (const char *order, GError **error)
 		if (str[0] == '+' || str[0] == '-')
 			str++;
 
-		if (matches (str, "active") == 0)
+		if (matches (str, "active"))
 			val = inverse ? NMC_SORT_ACTIVE_INV : NMC_SORT_ACTIVE;
-		else if (matches (str, "name") == 0)
+		else if (matches (str, "name"))
 			val = inverse ? NMC_SORT_NAME_INV : NMC_SORT_NAME;
-		else if (matches (str, "type") == 0)
+		else if (matches (str, "type"))
 			val = inverse ? NMC_SORT_TYPE_INV : NMC_SORT_TYPE;
-		else if (matches (str, "path") == 0)
+		else if (matches (str, "path"))
 			val = inverse ? NMC_SORT_PATH_INV : NMC_SORT_PATH;
 		else {
 			g_array_unref (order_arr);
@@ -1711,7 +1713,9 @@ get_connection (NmCli *nmc, int *argc, char ***argv, int *pos, GError **error)
 	    || strcmp (**argv, "uuid") == 0
 	    || strcmp (**argv, "path") == 0) {
 		selector = **argv;
-		if (next_arg (argc, argv) != 0) {
+		(*argc)--;
+		(*argv)++;
+		if (!*argc) {
 			g_set_error (error, NMCLI_ERROR, NMC_RESULT_ERROR_USER_INPUT,
 			             _("%s argument is missing"), selector);
 			return NULL;
@@ -1730,7 +1734,7 @@ get_connection (NmCli *nmc, int *argc, char ***argv, int *pos, GError **error)
 	 * don't switch to next argument.
 	 */
 	if (!pos || !*pos)
-		next_arg (argc, argv);
+		next_arg (nmc, argc, argv, NULL);
 
 	return connection;
 }
@@ -1742,41 +1746,32 @@ do_connections_show (NmCli *nmc, int argc, char **argv)
 	char *profile_flds = NULL, *active_flds = NULL;
 	GPtrArray *invisibles, *sorted_cons;
 	gboolean active_only = FALSE;
-	gboolean show_secrets = FALSE;
 	GArray *order = NULL;
-	int i;
-
-	/* check connection show options [--active] [--show-secrets] */
-	for (i = 0; i < 3; i++) {
-		if (argc == 1 && nmc->complete) {
-			nmc_complete_strings (*argv, "--active", "--show-secrets",
-			                             "--order", NULL);
-		}
+	int i, option;
 
-		if (!active_only && nmc_arg_is_option (*argv, "active")) {
+	/* check connection show options [--active] [--order <order spec>] */
+	while ((option = next_arg (nmc, &argc, &argv, "--active", "--order", NULL)) > 0) {
+		switch (option) {
+		case 1: /* --active */
 			active_only = TRUE;
-			next_arg (&argc, &argv);
-		} else if (!show_secrets && nmc_arg_is_option (*argv, "show-secrets")) {
-			/* --show-secrets is deprecated in favour of global --show-secrets */
-			/* Keep it here for backwards compatibility */
-			show_secrets = TRUE;
-			next_arg (&argc, &argv);
-		} else if (!order && nmc_arg_is_option (*argv, "order")) {
-			if (next_arg (&argc, &argv) != 0) {
+			break;
+		case 2: /* --order */
+			argc--;
+			argv++;
+			if (!argc) {
 				g_set_error_literal (&err, NMCLI_ERROR, 0,
 				                     _("'--order' argument is missing"));
 				goto finish;
 			}
-			/* TODO: complete --order */
 			order = parse_preferred_connection_order (*argv, &err);
 			if (err)
 				goto finish;
-			next_arg (&argc, &argv);
-		} else {
+			break;
+		default:
+			g_assert_not_reached();
 			break;
 		}
 	}
-	show_secrets = nmc->show_secrets || show_secrets;
 
 	if (argc == 0) {
 		const GPtrArray *connections;
@@ -1799,10 +1794,7 @@ do_connections_show (NmCli *nmc, int argc, char **argv)
 		tmpl = nmc_fields_con_show;
 		tmpl_len = sizeof (nmc_fields_con_show);
 		nmc->print_fields.indices = parse_output_fields (fields_str, tmpl, FALSE, NULL, &err);
-		if (err) {
-			goto finish;
-		}
-		if (!nmc_terse_option_check (nmc->print_output, nmc->required_fields, &err))
+		if (err)
 			goto finish;
 
 		/* Add headers */
@@ -1842,6 +1834,23 @@ do_connections_show (NmCli *nmc, int argc, char **argv)
 		g_free (nmc->required_fields);
 		nmc->required_fields = NULL;
 
+		/* Before printing the connections check if we have a "--show-secret"
+		 * option after the connection ids */
+		if (!nmc->show_secrets && !nmc->complete) {
+			int argc_cp = argc;
+			char **argv_cp = argv;
+
+			do {
+				if (   nm_streq (*argv_cp, "id")
+				    || nm_streq (*argv_cp, "uuid")
+				    || nm_streq (*argv_cp, "path")
+				    || nm_streq (*argv_cp, "apath")) {
+					argc_cp--;
+					argv_cp++;
+				}
+			} while (next_arg (nmc, &argc_cp, &argv_cp, NULL) != -1);
+		}
+
 		while (argc > 0) {
 			const GPtrArray *connections;
 			gboolean res;
@@ -1857,7 +1866,9 @@ do_connections_show (NmCli *nmc, int argc, char **argv)
 			    || strcmp (*argv, "path") == 0
 			    || strcmp (*argv, "apath") == 0) {
 				selector = *argv;
-				if (next_arg (&argc, &argv) != 0) {
+				argc--;
+				argv++;
+				if (!argc) {
 					g_string_printf (nmc->return_text, _("Error: %s argument is missing."), *(argv-1));
 					nmc->return_value = NMC_RESULT_ERROR_USER_INPUT;
 					goto finish;
@@ -1892,12 +1903,12 @@ do_connections_show (NmCli *nmc, int argc, char **argv)
 			if (!acon)
 				acon = get_ac_for_connection (active_cons, con);
 			if (active_only && !acon) {
-				next_arg (&argc, &argv);
+				next_arg (nmc, &argc, &argv, NULL);
 				continue;
 			}
 
 			if (nmc->complete) {
-				next_arg (&argc, &argv);
+				next_arg (nmc, &argc, &argv, NULL);
 				continue;
 			}
 
@@ -1909,9 +1920,9 @@ do_connections_show (NmCli *nmc, int argc, char **argv)
 			if (without_fields || profile_flds) {
 				if (con) {
 					nmc->required_fields = profile_flds;
-					if (show_secrets)
+					if (nmc->show_secrets)
 						update_secrets_in_connection (NM_REMOTE_CONNECTION (con), con);
-					res = nmc_connection_profile_details (con, nmc, show_secrets);
+					res = nmc_connection_profile_details (con, nmc, nmc->show_secrets);
 					nmc->required_fields = NULL;
 					if (!res)
 						goto finish;
@@ -1935,7 +1946,7 @@ do_connections_show (NmCli *nmc, int argc, char **argv)
 			 * so process the same argument again.
 			 */
 			if (!pos)
-				next_arg (&argc, &argv);
+				next_arg (nmc, &argc, &argv, NULL);
 		}
 	}
 
@@ -2122,104 +2133,90 @@ typedef struct {
 static void activate_connection_info_finish (ActivateConnectionInfo *info);
 
 static const char *
-vpn_connection_state_reason_to_string (NMVpnConnectionStateReason reason)
+active_connection_state_reason_to_string (NMActiveConnectionStateReason reason)
 {
 	switch (reason) {
-	case NM_VPN_CONNECTION_STATE_REASON_UNKNOWN:
-		return _("unknown reason");
-	case NM_VPN_CONNECTION_STATE_REASON_NONE:
-		return _("none");
-	case NM_VPN_CONNECTION_STATE_REASON_USER_DISCONNECTED:
-		return _("the user was disconnected");
-	case NM_VPN_CONNECTION_STATE_REASON_DEVICE_DISCONNECTED:
-		return _("the base network connection was interrupted");
-	case NM_VPN_CONNECTION_STATE_REASON_SERVICE_STOPPED:
-		return _("the VPN service stopped unexpectedly");
-	case NM_VPN_CONNECTION_STATE_REASON_IP_CONFIG_INVALID:
-		return _("the VPN service returned invalid configuration");
-	case NM_VPN_CONNECTION_STATE_REASON_CONNECT_TIMEOUT:
-		return _("the connection attempt timed out");
-	case NM_VPN_CONNECTION_STATE_REASON_SERVICE_START_TIMEOUT:
-		return _("the VPN service did not start in time");
-	case NM_VPN_CONNECTION_STATE_REASON_SERVICE_START_FAILED:
-		return _("the VPN service failed to start");
-	case NM_VPN_CONNECTION_STATE_REASON_NO_SECRETS:
-		return _("no valid VPN secrets");
-	case NM_VPN_CONNECTION_STATE_REASON_LOGIN_FAILED:
-		return _("invalid VPN secrets");
-	case NM_VPN_CONNECTION_STATE_REASON_CONNECTION_REMOVED:
-		return _("the connection was removed");
-	default:
-		return _("unknown");
-	}
+	case NM_ACTIVE_CONNECTION_STATE_REASON_UNKNOWN:
+		return _("Unknown reason");
+	case NM_ACTIVE_CONNECTION_STATE_REASON_NONE:
+		return _("The connection was disconnected");
+	case NM_ACTIVE_CONNECTION_STATE_REASON_USER_DISCONNECTED:
+		return _("Disconnected by user");
+	case NM_ACTIVE_CONNECTION_STATE_REASON_DEVICE_DISCONNECTED:
+		return _("The base network connection was interrupted");
+	case NM_ACTIVE_CONNECTION_STATE_REASON_SERVICE_STOPPED:
+		return _("The VPN service stopped unexpectedly");
+	case NM_ACTIVE_CONNECTION_STATE_REASON_IP_CONFIG_INVALID:
+		return _("The VPN service returned invalid configuration");
+	case NM_ACTIVE_CONNECTION_STATE_REASON_CONNECT_TIMEOUT:
+		return _("The connection attempt timed out");
+	case NM_ACTIVE_CONNECTION_STATE_REASON_SERVICE_START_TIMEOUT:
+		return _("The VPN service did not start in time");
+	case NM_ACTIVE_CONNECTION_STATE_REASON_SERVICE_START_FAILED:
+		return _("The VPN service failed to start");
+	case NM_ACTIVE_CONNECTION_STATE_REASON_NO_SECRETS:
+		return _("No valid secrets");
+	case NM_ACTIVE_CONNECTION_STATE_REASON_LOGIN_FAILED:
+		return _("Invalid secrets");
+	case NM_ACTIVE_CONNECTION_STATE_REASON_CONNECTION_REMOVED:
+		return _("The connection was removed");
+	case NM_ACTIVE_CONNECTION_STATE_REASON_DEPENDENCY_FAILED:
+		return _("Master connection failed");
+	case NM_ACTIVE_CONNECTION_STATE_REASON_DEVICE_REALIZE_FAILED:
+		return _("Could not create a software link");
+	case NM_ACTIVE_CONNECTION_STATE_REASON_DEVICE_REMOVED:
+		return _("The device disappeared");
+	}
+
+	g_return_val_if_reached (_("Invalid reason"));
 }
 
 static void
-device_state_cb (NMDevice *device, GParamSpec *pspec, ActivateConnectionInfo *info)
+check_activated (ActivateConnectionInfo *info)
 {
 	NmCli *nmc = info->nmc;
-	NMActiveConnection *active;
-	NMDeviceState state;
+	NMDevice *device = info->device;
+	NMActiveConnection *active = info->active;
 	NMActiveConnectionState ac_state;
+	NMActiveConnectionStateReason ac_reason;
+	NMDeviceState dev_state;
+	NMDeviceStateReason dev_reason;
 
-	active = nm_device_get_active_connection (device);
-	state = nm_device_get_state (device);
-
-	ac_state = active ? nm_active_connection_get_state (active) : NM_ACTIVE_CONNECTION_STATE_UNKNOWN;
-
-	if (ac_state == NM_ACTIVE_CONNECTION_STATE_ACTIVATED) {
-		if (nmc->print_output == NMC_PRINT_PRETTY)
-			nmc_terminal_erase_line ();
-		g_print (_("Connection successfully activated (D-Bus active path: %s)\n"),
-		         nm_object_get_path (NM_OBJECT (active)));
-		activate_connection_info_finish (info);
-	} else if (   ac_state == NM_ACTIVE_CONNECTION_STATE_ACTIVATING
-	           && state >= NM_DEVICE_STATE_IP_CONFIG
-	           && state <= NM_DEVICE_STATE_ACTIVATED) {
-		if (nmc->print_output == NMC_PRINT_PRETTY)
-			nmc_terminal_erase_line ();
-		g_print (_("Connection successfully activated (master waiting for slaves) (D-Bus active path: %s)\n"),
-		         nm_object_get_path (NM_OBJECT (active)));
-		activate_connection_info_finish (info);
-	}
-}
-
-static void
-active_connection_removed_cb (NMClient *client, NMActiveConnection *active, ActivateConnectionInfo *info)
-{
-	NmCli *nmc = info->nmc;
+	ac_state = nm_active_connection_get_state (active);
+	ac_reason = nm_active_connection_get_state_reason (active);
 
-	if (active == info->active) {
-		g_string_printf (nmc->return_text, _("Error: Connection activation failed."));
-		nmc->return_value = NMC_RESULT_ERROR_CON_ACTIVATION;
-		activate_connection_info_finish (info);
+	if (device) {
+		dev_state = nm_device_get_state (device);
+		dev_reason = nm_device_get_state_reason (device);
 	}
-}
 
-static void
-active_connection_state_cb (NMActiveConnection *active, GParamSpec *pspec, ActivateConnectionInfo *info)
-{
-	NmCli *nmc = info->nmc;
-	NMActiveConnectionState state;
-
-	state = nm_active_connection_get_state (active);
-
-	if (state == NM_ACTIVE_CONNECTION_STATE_ACTIVATED) {
+	if (ac_state == NM_ACTIVE_CONNECTION_STATE_ACTIVATED) {
 		if (nmc->print_output == NMC_PRINT_PRETTY)
 			nmc_terminal_erase_line ();
 		g_print (_("Connection successfully activated (D-Bus active path: %s)\n"),
 		         nm_object_get_path (NM_OBJECT (active)));
 		activate_connection_info_finish (info);
-	} else if (state == NM_ACTIVE_CONNECTION_STATE_DEACTIVATED) {
-		g_string_printf (nmc->return_text, _("Error: Connection activation failed."));
-		nmc->return_value = NMC_RESULT_ERROR_CON_ACTIVATION;
-		activate_connection_info_finish (info);
-	} else if (state == NM_ACTIVE_CONNECTION_STATE_ACTIVATING) {
+	} else if (ac_state == NM_ACTIVE_CONNECTION_STATE_DEACTIVATED) {
+		if (device && ac_reason == NM_ACTIVE_CONNECTION_STATE_REASON_DEVICE_DISCONNECTED) {
+			if (dev_state == NM_DEVICE_STATE_FAILED || dev_state == NM_DEVICE_STATE_DISCONNECTED) {
+				g_string_printf (nmc->return_text, _("Error: Connection activation failed: %s"),
+				                 nmc_device_reason_to_string (dev_reason));
+				nmc->return_value = NMC_RESULT_ERROR_CON_ACTIVATION;
+				activate_connection_info_finish (info);
+			} else {
+				/* Just wait for the device to go failed. We'll get a better error message. */
+				return;
+			}
+		} else {
+			g_string_printf (nmc->return_text, _("Error: Connection activation failed: %s"),
+			                 active_connection_state_reason_to_string (ac_reason));
+			nmc->return_value = NMC_RESULT_ERROR_CON_ACTIVATION;
+			activate_connection_info_finish (info);
+		}
+	} else if (ac_state == NM_ACTIVE_CONNECTION_STATE_ACTIVATING) {
 		/* activating master connection does not automatically activate any slaves, so their
 		 * active connection state will not progress beyond ACTIVATING state.
 		 * Monitor the device instead. */
-		const GPtrArray *devices;
-		NMDevice *device;
 
 		if (nmc->secret_agent) {
 			NMRemoteConnection *connection = nm_active_connection_get_connection (active);
@@ -2228,53 +2225,34 @@ active_connection_state_cb (NMActiveConnection *active, GParamSpec *pspec, Activ
 			                               nm_connection_get_path (NM_CONNECTION (connection)));
 		}
 
-		devices = nm_active_connection_get_devices (active);
-		device = devices->len ? g_ptr_array_index (devices, 0) : NULL;
 		if (   device
 		    && (   NM_IS_DEVICE_BOND (device)
 		        || NM_IS_DEVICE_TEAM (device)
-		        || NM_IS_DEVICE_BRIDGE (device))) {
-			g_signal_connect (device, "notify::" NM_DEVICE_STATE, G_CALLBACK (device_state_cb), info);
-			device_state_cb (device, NULL, info);
+		        || NM_IS_DEVICE_BRIDGE (device))
+	            && dev_state >= NM_DEVICE_STATE_IP_CONFIG
+	            && dev_state <= NM_DEVICE_STATE_ACTIVATED) {
+			if (nmc->print_output == NMC_PRINT_PRETTY)
+				nmc_terminal_erase_line ();
+			g_print (_("Connection successfully activated (master waiting for slaves) (D-Bus active path: %s)\n"),
+			          nm_object_get_path (NM_OBJECT (active)));
+			activate_connection_info_finish (info);
 		}
 	}
 }
 
 static void
-vpn_connection_state_cb (NMVpnConnection *vpn,
-                         NMVpnConnectionState state,
-                         NMVpnConnectionStateReason reason,
-                         ActivateConnectionInfo *info)
+device_state_cb (NMDevice *device, GParamSpec *pspec, ActivateConnectionInfo *info)
 {
-	NmCli *nmc = info->nmc;
-
-	switch (state) {
-	case NM_VPN_CONNECTION_STATE_PREPARE:
-	case NM_VPN_CONNECTION_STATE_NEED_AUTH:
-	case NM_VPN_CONNECTION_STATE_CONNECT:
-	case NM_VPN_CONNECTION_STATE_IP_CONFIG_GET:
-		/* no operation */
-		break;
-
-	case NM_VPN_CONNECTION_STATE_ACTIVATED:
-		if (nmc->print_output == NMC_PRINT_PRETTY)
-			nmc_terminal_erase_line ();
-		g_print (_("VPN connection successfully activated (D-Bus active path: %s)\n"),
-		         nm_object_get_path (NM_OBJECT (vpn)));
-		activate_connection_info_finish (info);
-		break;
-
-	case NM_VPN_CONNECTION_STATE_FAILED:
-	case NM_VPN_CONNECTION_STATE_DISCONNECTED:
-		g_string_printf (nmc->return_text, _("Error: Connection activation failed: %s."),
-		                 vpn_connection_state_reason_to_string (reason));
-		nmc->return_value = NMC_RESULT_ERROR_CON_ACTIVATION;
-		activate_connection_info_finish (info);
-		break;
+	check_activated (info);
+}
 
-	default:
-		break;
-	}
+static void
+active_connection_state_cb (NMActiveConnection *active,
+                            NMActiveConnectionState state,
+                            NMActiveConnectionStateReason reason,
+                            ActivateConnectionInfo *info)
+{
+	check_activated (info);
 }
 
 static void
@@ -2306,24 +2284,28 @@ progress_cb (gpointer user_data)
 }
 
 static gboolean
-progress_device_cb (gpointer user_data)
+progress_active_connection_cb (gpointer user_data)
 {
-	NMDevice *device = (NMDevice *) user_data;
-
-	nmc_terminal_show_progress (device ? nmc_device_state_to_string (nm_device_get_state (device)) : "");
+	NMActiveConnection *active = user_data;
+	const char *str;
+	NMDevice *device;
+	NMActiveConnectionState ac_state;
+	const GPtrArray *ac_devs;
 
-	return TRUE;
-}
+	ac_state = nm_active_connection_get_state (active);
 
-static gboolean
-progress_vpn_cb (gpointer user_data)
-{
-	NMVpnConnection *vpn = (NMVpnConnection *) user_data;
-	const char *str;
+	if (ac_state == NM_ACTIVE_CONNECTION_STATE_ACTIVATING) {
+		/* If the connection is activating, the device state
+		 * is more interesting. */
+		ac_devs = nm_active_connection_get_devices (active);
+		device = ac_devs->len > 0 ? g_ptr_array_index (ac_devs, 0) : NULL;
+	} else {
+		device = NULL;
+	}
 
-	str = NM_IS_VPN_CONNECTION (vpn) ?
-	        vpn_connection_state_to_string (nm_vpn_connection_get_vpn_state (vpn)) :
-	        "";
+	str =   device
+	      ? nmc_device_state_to_string (nm_device_get_state (device))
+	      : active_connection_state_to_string (ac_state);
 
 	nmc_terminal_show_progress (str);
 
@@ -2339,14 +2321,9 @@ activate_connection_info_finish (ActivateConnectionInfo *info)
 	}
 
 	if (info->active) {
-		if (NM_IS_VPN_CONNECTION (info->active))
-			g_signal_handlers_disconnect_by_func (info->active, G_CALLBACK (vpn_connection_state_cb), info);
-		else
-			g_signal_handlers_disconnect_by_func (info->active, G_CALLBACK (active_connection_state_cb), info);
+		g_signal_handlers_disconnect_by_func (info->active, G_CALLBACK (active_connection_state_cb), info);
 		g_object_unref (info->active);
-
 	}
-	g_signal_handlers_disconnect_by_func (info->nmc->client, G_CALLBACK (active_connection_removed_cb), info);
 
 	g_free (info);
 	quit ();
@@ -2391,34 +2368,26 @@ activate_connection_cb (GObject *client, GAsyncResult *result, gpointer user_dat
 			}
 			activate_connection_info_finish (info);
 		} else {
-			if (NM_IS_VPN_CONNECTION (active)) {
-				/* Monitor VPN state */
-				g_signal_connect (G_OBJECT (active), "vpn-state-changed", G_CALLBACK (vpn_connection_state_cb), info);
-
-				/* Start progress indication showing VPN states */
-				if (nmc->print_output == NMC_PRINT_PRETTY) {
-					if (progress_id)
-						g_source_remove (progress_id);
-					progress_id = g_timeout_add (120, progress_vpn_cb, NM_VPN_CONNECTION (active));
-				}
-			} else {
-				g_signal_connect (active, "notify::state", G_CALLBACK (active_connection_state_cb), info);
-				active_connection_state_cb (active, NULL, info);
-
-				/* Start progress indication showing device states */
-				if (nmc->print_output == NMC_PRINT_PRETTY) {
-					if (progress_id)
-						g_source_remove (progress_id);
-					progress_id = g_timeout_add (120, progress_device_cb, device);
-				}
+			/* Monitor the active connection and device (if available) states */
+			g_signal_connect (active, "state-changed", G_CALLBACK (active_connection_state_cb), info);
+			if (device)
+				g_signal_connect (device, "notify::" NM_DEVICE_STATE, G_CALLBACK (device_state_cb), info);
+			/* Both active_connection_state_cb () and device_state_cb () will just
+			 * call check_activated (info). So, just call it once directly after
+			 * connecting on both the signals of the objects and skip the call to
+			 * the callbacks.
+			 */
+			check_activated (info);
+
+			/* Start progress indication showing VPN states */
+			if (nmc->print_output == NMC_PRINT_PRETTY) {
+				if (progress_id)
+					g_source_remove (progress_id);
+				progress_id = g_timeout_add (120, progress_active_connection_cb, active);
 			}
 
 			/* Start timer not to loop forever when signals are not emitted */
 			g_timeout_add_seconds (nmc->timeout, activate_connection_timeout_cb, info);
-
-			/* Fail when the active connection goes away. */
-			g_signal_connect (nmc->client, NM_CLIENT_ACTIVE_CONNECTION_REMOVED,
-			                  G_CALLBACK (active_connection_removed_cb), info);
 		}
 	}
 }
@@ -2602,8 +2571,8 @@ do_connection_up (NmCli *nmc, int argc, char **argv)
 	gs_free_error GError *error = NULL;
 	char **arg_arr = NULL;
 	int arg_num;
-	char ***argv_ptr = &argv;
-	int *argc_ptr = &argc;
+	char ***argv_ptr;
+	int *argc_ptr;
 
 	/*
 	 * Set default timeout for connection activation.
@@ -2612,6 +2581,10 @@ do_connection_up (NmCli *nmc, int argc, char **argv)
 	if (nmc->timeout == -1)
 		nmc->timeout = 90;
 
+	next_arg (nmc, &argc, &argv, NULL);
+	argv_ptr = &argv;
+	argc_ptr = &argc;
+
 	if (argc == 0 && nmc->ask) {
 		char *line;
 
@@ -2638,7 +2611,9 @@ do_connection_up (NmCli *nmc, int argc, char **argv)
 			nmc_complete_strings (*argv, "ifname", "ap", "passwd-file", NULL);
 
 		if (strcmp (*argv, "ifname") == 0) {
-			if (next_arg (&argc, &argv) != 0) {
+			argc--;
+			argv++;
+			if (!argc) {
 				g_string_printf (nmc->return_text, _("Error: %s argument is missing."), *(argv-1));
 				return NMC_RESULT_ERROR_USER_INPUT;
 			}
@@ -2648,7 +2623,9 @@ do_connection_up (NmCli *nmc, int argc, char **argv)
 				nmc_complete_device (nmc->client, ifname, ap != NULL);
 		}
 		else if (strcmp (*argv, "ap") == 0) {
-			if (next_arg (&argc, &argv) != 0) {
+			argc--;
+			argv++;
+			if (!argc) {
 				g_string_printf (nmc->return_text, _("Error: %s argument is missing."), *(argv-1));
 				return NMC_RESULT_ERROR_USER_INPUT;
 			}
@@ -2658,7 +2635,9 @@ do_connection_up (NmCli *nmc, int argc, char **argv)
 				nmc_complete_bssid (nmc->client, ifname, ap);
 		}
 		else if (strcmp (*argv, "passwd-file") == 0) {
-			if (next_arg (&argc, &argv) != 0) {
+			argc--;
+			argv++;
+			if (!argc) {
 				g_string_printf (nmc->return_text, _("Error: %s argument is missing."), *(argv-1));
 				return NMC_RESULT_ERROR_USER_INPUT;
 			}
@@ -2672,8 +2651,7 @@ do_connection_up (NmCli *nmc, int argc, char **argv)
 			g_printerr (_("Unknown parameter: %s\n"), *argv);
 		}
 
-		argc--;
-		argv++;
+		next_arg (nmc, &argc, &argv, NULL);
 	}
 
 	if (nmc->complete)
@@ -2788,15 +2766,19 @@ do_connection_down (NmCli *nmc, int argc, char **argv)
 	NMActiveConnection *active;
 	ConnectionCbInfo *info = NULL;
 	const GPtrArray *active_cons;
-	GSList *queue = NULL, *iter;
+	GSList *queue = NULL, *iter, *next;
 	char **arg_arr = NULL;
-	char **arg_ptr = argv;
-	int arg_num = argc;
+	char **arg_ptr;
+	int arg_num;
 	int idx = 0;
 
 	if (nmc->timeout == -1)
 		nmc->timeout = 10;
 
+	next_arg (nmc, &argc, &argv, NULL);
+	arg_ptr = argv;
+	arg_num = argc;
+
 	if (argc == 0) {
 		/* nmc_do_cmd() should not call this with argc=0. */
 		g_assert (!nmc->complete);
@@ -2829,7 +2811,9 @@ do_connection_down (NmCli *nmc, int argc, char **argv)
 		    || strcmp (*arg_ptr, "apath") == 0) {
 
 			selector = *arg_ptr;
-			if (next_arg (&arg_num, &arg_ptr) != 0) {
+			arg_num--;
+			arg_ptr++;
+			if (!arg_num) {
 				g_string_printf (nmc->return_text, _("Error: %s argument is missing."), selector);
 				nmc->return_value = NMC_RESULT_ERROR_USER_INPUT;
 				goto finish;
@@ -2853,7 +2837,7 @@ do_connection_down (NmCli *nmc, int argc, char **argv)
 		}
 
 		if (idx == 0)
-			next_arg (&arg_num, &arg_ptr);
+			next_arg (nmc->ask ? NULL : nmc, &arg_num, &arg_ptr, NULL);
 	}
 
 	if (!queue) {
@@ -2875,17 +2859,36 @@ do_connection_down (NmCli *nmc, int argc, char **argv)
 		info->timeout_id = g_timeout_add_seconds (nmc->timeout, connection_op_timeout_cb, info);
 	}
 
-	for (iter = queue; iter; iter = g_slist_next (iter)) {
+	iter = queue;
+	while (iter) {
+		GError *error = NULL;
+
+		next = g_slist_next (iter);
 		active = iter->data;
 
-		if (info)
+		if (info) {
 			g_signal_connect (active,
 			                  "notify::" NM_ACTIVE_CONNECTION_STATE,
 			                  G_CALLBACK (down_active_connection_state_cb),
 			                  info);
+		}
 
 		/* Now deactivate the connection */
-		nm_client_deactivate_connection (nmc->client, active, NULL, NULL);
+		if (!nm_client_deactivate_connection (nmc->client, active, NULL, &error)) {
+			g_print (_("Connection '%s' deactivation failed: %s\n"),
+			         nm_active_connection_get_id (active), error->message);
+			g_error_free (error);
+
+			if (info) {
+				g_signal_handlers_disconnect_by_func (active,
+				                                      down_active_connection_state_cb,
+				                                      info);
+				/* Remove the active connection from @queue */
+				connection_cb_info_finish (info, active);
+			}
+		}
+
+		iter = next;
 	}
 
 finish:
@@ -3071,6 +3074,13 @@ static const NameItem nmc_vxlan_settings [] = {
 	{ NULL, NULL, NULL, FALSE }
 };
 
+static const NameItem nmc_dummy_settings [] = {
+	{ NM_SETTING_CONNECTION_SETTING_NAME,  NULL,       NULL, TRUE  },
+	{ NM_SETTING_DUMMY_SETTING_NAME,       NULL,       NULL, TRUE  },
+	{ NM_SETTING_WIRED_SETTING_NAME,       "ethernet", NULL, FALSE },
+	{ NULL, NULL, NULL, FALSE }
+};
+
 /* Available connection types */
 static const NameItem nmc_valid_connection_types[] = {
 	{ NM_SETTING_GENERIC_SETTING_NAME,    NULL,        nmc_generic_settings      }, /* Needs to be first. */
@@ -3098,6 +3108,7 @@ static const NameItem nmc_valid_connection_types[] = {
 	{ NM_SETTING_MACSEC_SETTING_NAME,     NULL,        nmc_macsec_settings       },
 	{ NM_SETTING_MACVLAN_SETTING_NAME,    NULL,        nmc_macvlan_settings      },
 	{ NM_SETTING_VXLAN_SETTING_NAME,      NULL,        nmc_vxlan_settings        },
+	{ NM_SETTING_DUMMY_SETTING_NAME,      NULL,        nmc_dummy_settings        },
 	{ NULL, NULL, NULL }
 };
 
@@ -3545,7 +3556,7 @@ unique_master_iface_ifname (const GPtrArray *connections,
 {
 	NMConnection *connection;
 	char *new_name;
-	unsigned int num = 1;
+	unsigned num = 1;
 	int i = 0;
 	const char *ifname = NULL;
 
@@ -4156,9 +4167,9 @@ set_bond_monitoring_mode (NmCli *nmc, NMConnection *con, OptionInfo *option, con
 		monitor_mode = g_strdup (WORD_MIIMON);
 	}
 
-	if (matches (monitor_mode, WORD_MIIMON) == 0)
+	if (matches (monitor_mode, WORD_MIIMON))
 		enable_options (NM_SETTING_BOND_SETTING_NAME, NM_SETTING_BOND_OPTIONS, miimon_opts);
-	else if (matches (monitor_mode, WORD_ARP) == 0)
+	else if (matches (monitor_mode, WORD_ARP))
 		enable_options (NM_SETTING_BOND_SETTING_NAME, NM_SETTING_BOND_OPTIONS, arp_opts);
 	else {
 		g_set_error (error, NMCLI_ERROR, NMC_RESULT_ERROR_USER_INPUT,
@@ -4535,7 +4546,8 @@ get_value (const char **value, int *argc, char ***argv, const char *option, GErr
 	else
 		*value = *argv[0];
 
-	next_arg (argc, argv);
+	(*argc)--;
+	(*argv)++;
 	return TRUE;
 }
 
@@ -4599,7 +4611,8 @@ nmc_read_connection_properties (NmCli *nmc,
 				return FALSE;
 			}
 
-			next_arg (argc, argv);
+			(*argc)--;
+			(*argv)++;
 			if (!get_value (&value, argc, argv, option, error))
 				return FALSE;
 
@@ -4638,7 +4651,8 @@ nmc_read_connection_properties (NmCli *nmc,
 			if (*argc == 1 && nmc->complete)
 				complete_property_name (nmc, connection, modifier, option, NULL);
 
-			next_arg (argc, argv);
+			(*argc)--;
+			(*argv)++;
 			if (!get_value (&value, argc, argv, option, error))
 				return FALSE;
 
@@ -4844,7 +4858,7 @@ want_provide_opt_args (const char *type, int num)
 	                                 "Do you want to provide them? %s", num),
 	                       prompt_yes_no (TRUE, NULL));
 	answer = answer ? g_strstrip (answer) : NULL;
-	if (answer && matches (answer, WORD_LOC_YES) != 0)
+	if (answer && !matches (answer, WORD_LOC_YES))
 		ret = FALSE;
 	g_free (answer);
 	return ret;
@@ -4956,6 +4970,8 @@ do_connection_add (NmCli *nmc, int argc, char **argv)
 	OptionInfo *candidate;
 	gboolean seen_dash_dash = FALSE;
 
+	next_arg (nmc, &argc, &argv, NULL);
+
 	rl_attempted_completion_function = (rl_completion_func_t *) nmcli_con_add_tab_completion;
 
 	nmc->return_value = NMC_RESULT_SUCCESS;
@@ -4975,13 +4991,15 @@ read_properties:
 			 * options and properties to be separated with "--" */
 			g_clear_error (&error);
 			seen_dash_dash = TRUE;
-			next_arg (&argc, &argv);
+			next_arg (nmc, &argc, &argv, NULL);
 			goto read_properties;
 		} else if (g_strcmp0 (*argv, "save") == 0) {
 			/* It would be better if "save" was a separate argument and not
 			 * mixed with properties, but there's not much we can do about it now. */
 			g_clear_error (&error);
-			if (next_arg (&argc, &argv) != 0) {
+			argc--;
+			argv++;
+			if (!argc) {
 				g_string_printf (nmc->return_text,
 				                 _("Error: value for '%s' argument is required."),
 				                "save");
@@ -4995,7 +5013,7 @@ read_properties:
 				g_clear_error (&error);
 				goto finish;
 			}
-			next_arg (&argc, &argv);
+			next_arg (nmc, &argc, &argv, NULL);
 			goto read_properties;
 		}
 
@@ -5441,13 +5459,13 @@ get_gen_func_cmd_nmcli (const char *str)
 {
 	if (!str)
 		return NULL;
-	if (matches (str, "status-line") == 0)
+	if (matches (str, "status-line"))
 		return gen_func_bool_values;
-	if (matches (str, "save-confirmation") == 0)
+	if (matches (str, "save-confirmation"))
 		return gen_func_bool_values;
-	if (matches (str, "show-secrets") == 0)
+	if (matches (str, "show-secrets"))
 		return gen_func_bool_values;
-	if (matches (str, "prompt-color") == 0)
+	if (matches (str, "prompt-color"))
 		return gen_cmd_nmcli_prompt_color;
 	return NULL;
 }
@@ -5524,7 +5542,7 @@ should_complete_cmd (const char *line, int end, const char *cmd,
 			*prev_word = g_strdup (word3);
 	}
 
-	if (word1 && matches (word1, cmd) == 0)
+	if (word1 && matches (word1, cmd))
 		ret = TRUE;
 
 	g_free (tmp);
@@ -6075,29 +6093,29 @@ parse_editor_main_cmd (const char *cmd, char **cmd_arg)
 		return NMC_EDITOR_MAIN_CMD_UNKNOWN;
 	}
 
-	if (matches (vec[0], "goto") == 0)
+	if (matches (vec[0], "goto"))
 		editor_cmd = NMC_EDITOR_MAIN_CMD_GOTO;
-	else if (matches (vec[0], "remove") == 0)
+	else if (matches (vec[0], "remove"))
 		editor_cmd = NMC_EDITOR_MAIN_CMD_REMOVE;
-	else if (matches (vec[0], "set") == 0)
+	else if (matches (vec[0], "set"))
 		editor_cmd = NMC_EDITOR_MAIN_CMD_SET;
-	else if (matches (vec[0], "describe") == 0)
+	else if (matches (vec[0], "describe"))
 		editor_cmd = NMC_EDITOR_MAIN_CMD_DESCRIBE;
-	else if (matches (vec[0], "print") == 0)
+	else if (matches (vec[0], "print"))
 		editor_cmd = NMC_EDITOR_MAIN_CMD_PRINT;
-	else if (matches (vec[0], "verify") == 0)
+	else if (matches (vec[0], "verify"))
 		editor_cmd = NMC_EDITOR_MAIN_CMD_VERIFY;
-	else if (matches (vec[0], "save") == 0)
+	else if (matches (vec[0], "save"))
 		editor_cmd = NMC_EDITOR_MAIN_CMD_SAVE;
-	else if (matches (vec[0], "activate") == 0)
+	else if (matches (vec[0], "activate"))
 		editor_cmd = NMC_EDITOR_MAIN_CMD_ACTIVATE;
-	else if (matches (vec[0], "back") == 0)
+	else if (matches (vec[0], "back"))
 		editor_cmd = NMC_EDITOR_MAIN_CMD_BACK;
-	else if (matches (vec[0], "help") == 0 || strcmp (vec[0], "?") == 0)
+	else if (matches (vec[0], "help") || strcmp (vec[0], "?") == 0)
 		editor_cmd = NMC_EDITOR_MAIN_CMD_HELP;
-	else if (matches (vec[0], "quit") == 0)
+	else if (matches (vec[0], "quit"))
 		editor_cmd = NMC_EDITOR_MAIN_CMD_QUIT;
-	else if (matches (vec[0], "nmcli") == 0)
+	else if (matches (vec[0], "nmcli"))
 		editor_cmd = NMC_EDITOR_MAIN_CMD_NMCLI;
 
 	/* set pointer to command argument */
@@ -6263,23 +6281,23 @@ parse_editor_sub_cmd (const char *cmd, char **cmd_arg)
 		return NMC_EDITOR_SUB_CMD_UNKNOWN;
 	}
 
-	if (matches (vec[0], "set") == 0)
+	if (matches (vec[0], "set"))
 		editor_cmd = NMC_EDITOR_SUB_CMD_SET;
-	else if (matches (vec[0], "add") == 0)
+	else if (matches (vec[0], "add"))
 		editor_cmd = NMC_EDITOR_SUB_CMD_ADD;
-	else if (matches (vec[0], "change") == 0)
+	else if (matches (vec[0], "change"))
 		editor_cmd = NMC_EDITOR_SUB_CMD_CHANGE;
-	else if (matches (vec[0], "remove") == 0)
+	else if (matches (vec[0], "remove"))
 		editor_cmd = NMC_EDITOR_SUB_CMD_REMOVE;
-	else if (matches (vec[0], "describe") == 0)
+	else if (matches (vec[0], "describe"))
 		editor_cmd = NMC_EDITOR_SUB_CMD_DESCRIBE;
-	else if (matches (vec[0], "print") == 0)
+	else if (matches (vec[0], "print"))
 		editor_cmd = NMC_EDITOR_SUB_CMD_PRINT;
-	else if (matches (vec[0], "back") == 0)
+	else if (matches (vec[0], "back"))
 		editor_cmd = NMC_EDITOR_SUB_CMD_BACK;
-	else if (matches (vec[0], "help") == 0 || strcmp (vec[0], "?") == 0)
+	else if (matches (vec[0], "help") || strcmp (vec[0], "?") == 0)
 		editor_cmd = NMC_EDITOR_SUB_CMD_HELP;
-	else if (matches (vec[0], "quit") == 0)
+	else if (matches (vec[0], "quit"))
 		editor_cmd = NMC_EDITOR_SUB_CMD_QUIT;
 
 	/* set pointer to command argument */
@@ -6595,7 +6613,7 @@ confirm_quit (void)
 	                         "Do you really want to quit? %s"),
 	                       prompt_yes_no (FALSE, NULL));
 	answer = answer ? g_strstrip (answer) : NULL;
-	if (answer && matches (answer, WORD_LOC_YES) == 0)
+	if (answer && matches (answer, WORD_LOC_YES))
 		want_quit = TRUE;
 
 	g_free (answer);
@@ -6750,10 +6768,10 @@ property_edit_submenu (NmCli *nmc,
 		case NMC_EDITOR_SUB_CMD_PRINT:
 			/* Print current connection settings/properties */
 			if (cmd_property_arg) {
-				if (matches (cmd_property_arg, "setting") == 0)
+				if (matches (cmd_property_arg, "setting"))
 					editor_show_setting (curr_setting, nmc);
-				else if (   matches (cmd_property_arg, "connection") == 0
-				         || matches (cmd_property_arg, "all") == 0)
+				else if (   matches (cmd_property_arg, "connection")
+				         || matches (cmd_property_arg, "all"))
 					editor_show_connection (connection, nmc);
 				else
 					g_print (_("Unknown command argument: '%s'\n"), cmd_property_arg);
@@ -6943,7 +6961,7 @@ confirm_connection_saving (NMConnection *local, NMConnection *remote)
 		                         "That might result in an immediate activation of the connection.\n"
 		                         "Do you still want to save? %s"), prompt_yes_no (TRUE, NULL));
 		answer = answer ? g_strstrip (answer) : NULL;
-		if (!answer || matches (answer, WORD_LOC_YES) == 0)
+		if (!answer || matches (answer, WORD_LOC_YES))
 			confirmed = TRUE;
 		else
 			confirmed = FALSE;
@@ -6995,7 +7013,7 @@ menu_switch_to_level1 (NmCli *nmc,
 }
 
 static gboolean
-editor_menu_main (NmCli *nmc, NMConnection *connection, const char *connection_type)
+editor_menu_main (NmCli *nmc, NMConnection *connection)
 {
 	NMSettingConnection *s_con;
 	NMRemoteConnection *rem_con;
@@ -7023,7 +7041,7 @@ editor_menu_main (NmCli *nmc, NMConnection *connection, const char *connection_t
 		s_type = nm_setting_connection_get_slave_type (s_con);
 	slv_type = g_strdup_printf ("%s-slave", s_type ? s_type : "no");
 
-	valid_settings_main = get_valid_settings_array (connection_type);
+	valid_settings_main = get_valid_settings_array (nm_connection_get_connection_type (connection));
 	valid_settings_slave = get_valid_settings_array (slv_type);
 	g_free (slv_type);
 
@@ -7510,9 +7528,9 @@ editor_menu_main (NmCli *nmc, NMConnection *connection, const char *connection_t
 
 				/* parse argument */
 				if (cmd_arg) {
-					if (matches (cmd_arg, "temporary") == 0)
+					if (matches (cmd_arg, "temporary"))
 						persistent = FALSE;
-					else if (matches (cmd_arg, "persistent") == 0)
+					else if (matches (cmd_arg, "persistent"))
 						persistent = TRUE;
 					else {
 						g_print (_("Error: invalid argument '%s'\n"), cmd_arg);
@@ -7672,7 +7690,7 @@ editor_menu_main (NmCli *nmc, NMConnection *connection, const char *connection_t
 			break;
 
 		case NMC_EDITOR_MAIN_CMD_NMCLI:
-			if (cmd_arg_p && matches (cmd_arg_p, "status-line") == 0) {
+			if (cmd_arg_p && matches (cmd_arg_p, "status-line")) {
 				GError *tmp_err = NULL;
 				gboolean bb;
 				if (!nmc_string_to_bool (cmd_arg_v ? g_strstrip (cmd_arg_v) : "", &bb, &tmp_err)) {
@@ -7680,7 +7698,7 @@ editor_menu_main (NmCli *nmc, NMConnection *connection, const char *connection_t
 					g_clear_error (&tmp_err);
 				} else
 					nmc->editor_status_line = bb;
-			} else if (cmd_arg_p && matches (cmd_arg_p, "save-confirmation") == 0) {
+			} else if (cmd_arg_p && matches (cmd_arg_p, "save-confirmation")) {
 				GError *tmp_err = NULL;
 				gboolean bb;
 				if (!nmc_string_to_bool (cmd_arg_v ? g_strstrip (cmd_arg_v) : "", &bb, &tmp_err)) {
@@ -7688,7 +7706,7 @@ editor_menu_main (NmCli *nmc, NMConnection *connection, const char *connection_t
 					g_clear_error (&tmp_err);
 				} else
 					nmc->editor_save_confirmation = bb;
-			} else if (cmd_arg_p && matches (cmd_arg_p, "show-secrets") == 0) {
+			} else if (cmd_arg_p && matches (cmd_arg_p, "show-secrets")) {
 				GError *tmp_err = NULL;
 				gboolean bb;
 				if (!nmc_string_to_bool (cmd_arg_v ? g_strstrip (cmd_arg_v) : "", &bb, &tmp_err)) {
@@ -7696,7 +7714,7 @@ editor_menu_main (NmCli *nmc, NMConnection *connection, const char *connection_t
 					g_clear_error (&tmp_err);
 				} else
 					nmc->editor_show_secrets = bb;
-			} else if (cmd_arg_p && matches (cmd_arg_p, "prompt-color") == 0) {
+			} else if (cmd_arg_p && matches (cmd_arg_p, "prompt-color")) {
 				GError *tmp_err = NULL;
 				NmcTermColor color;
 				color = nmc_term_color_parse_string (cmd_arg_v ? g_strstrip (cmd_arg_v) : " ", &tmp_err);
@@ -7876,6 +7894,18 @@ editor_init_existing_connection (NMConnection *connection)
 		nmc_setting_connection_connect_handlers (s_con, connection);
 }
 
+static void
+nmc_complete_connection_type (const char *prefix, const NameItem *types)
+{
+	while (types->name) {
+		if (!*prefix || matches (prefix, types->name))
+			g_print ("%s\n", types->name);
+		if (types->alias && (!*prefix || matches (prefix, types->alias)))
+			g_print ("%s\n", types->alias);
+		types++;
+	}
+}
+
 static NMCResultCode
 do_connection_edit (NmCli *nmc, int argc, char **argv)
 {
@@ -7903,9 +7933,9 @@ do_connection_edit (NmCli *nmc, int argc, char **argv)
 	                         {"path",     TRUE, &con_path, FALSE},
 	                         {NULL} };
 
-	/* TODO: complete uuid, path or id */
-	if (nmc->complete)
-		return nmc->return_value;
+	next_arg (nmc, &argc, &argv, NULL);
+	if (argc == 1 && nmc->complete)
+		nmc_complete_strings (*argv, "type", "con-name", "id", "uuid", "path", NULL);
 
 	nmc->return_value = NMC_RESULT_SUCCESS;
 
@@ -7952,7 +7982,10 @@ do_connection_edit (NmCli *nmc, int argc, char **argv)
 		/* Existing connection */
 		NMConnection *found_con;
 
-		found_con = nmc_find_connection (connections, selector, con, NULL, FALSE);
+		found_con = nmc_find_connection (connections, selector, con, NULL, nmc->complete);
+		if (nmc->complete)
+			goto error;
+
 		if (!found_con) {
 			g_string_printf (nmc->return_text, _("Error: Unknown connection '%s'."), con);
 			nmc->return_value = NMC_RESULT_ERROR_NOT_FOUND;
@@ -7984,6 +8017,12 @@ do_connection_edit (NmCli *nmc, int argc, char **argv)
 		editor_init_existing_connection (connection);
 	} else {
 		/* New connection */
+		if (nmc->complete) {
+			if (type && argc == 0)
+				nmc_complete_connection_type (type, nmc_valid_connection_types);
+			goto error;
+		}
+
 		connection_type = check_valid_name (type, nmc_valid_connection_types, NULL, &err1);
 		tmp_str = get_valid_options_string (nmc_valid_connection_types, NULL);
 
@@ -8044,11 +8083,11 @@ do_connection_edit (NmCli *nmc, int argc, char **argv)
 
 	/* Set global variables for use in TAB completion */
 	nmc_tab_completion.nmc = nmc;
-	nmc_tab_completion.con_type = g_strdup (connection_type);
+	nmc_tab_completion.con_type = g_strdup (nm_connection_get_connection_type (connection));
 	nmc_tab_completion.connection = connection;
 
 	/* Run menu loop */
-	editor_menu_main (nmc, connection, connection_type);
+	editor_menu_main (nmc, connection);
 
 	if (connection)
 		g_object_unref (connection);
@@ -8098,11 +8137,10 @@ do_connection_modify (NmCli *nmc,
 	GError *error = NULL;
 	gboolean temporary = FALSE;
 
-	if (argc && nmc_arg_is_option (*argv, "temporary")) {
-		if (nmc->complete)
-			goto finish;
+	/* Check --temporary */
+	if (next_arg (nmc, &argc, &argv, "--temporary", NULL) > 0) {
 		temporary = TRUE;
-		next_arg (&argc, &argv);
+		next_arg (nmc, &argc, &argv, NULL);
 	}
 
 	connection = get_connection (nmc, &argc, &argv, NULL, &error);
@@ -8191,12 +8229,17 @@ do_connection_clone (NmCli *nmc, int argc, char **argv)
 	gboolean temporary = FALSE;
 	char **arg_arr = NULL;
 	int arg_num;
-	char ***argv_ptr = &argv;
-	int *argc_ptr = &argc;
+	char ***argv_ptr;
+	int *argc_ptr;
 	GError *error = NULL;
 
-	if (argc == 1 && nmc->complete)
-		nmc_complete_strings (*argv, "temporary", NULL);
+	if (next_arg (nmc, &argc, &argv, "--temporary", NULL) > 0) {
+		temporary = TRUE;
+		next_arg (nmc, &argc, &argv, NULL);
+	}
+
+	argv_ptr = &argv;
+	argc_ptr = &argc;
 
 	if (argc == 0 && nmc->ask) {
 		char *line;
@@ -8209,9 +8252,6 @@ do_connection_clone (NmCli *nmc, int argc, char **argv)
 		g_free (line);
 		argv_ptr = &arg_arr;
 		argc_ptr = &arg_num;
-	} else if (nmc_arg_is_option (*argv, "temporary")) {
-		temporary = TRUE;
-		next_arg (&argc, &argv);
 	}
 
 	connection = get_connection (nmc, argc_ptr, argv_ptr, NULL, &error);
@@ -8234,7 +8274,7 @@ do_connection_clone (NmCli *nmc, int argc, char **argv)
 		goto finish;
 	}
 
-	if (next_arg (argc_ptr, argv_ptr) == 0) {
+	if (next_arg (nmc->ask ? NULL : nmc, argc_ptr, argv_ptr, NULL) == 0) {
 		g_string_printf (nmc->return_text, _("Error: unknown extra argument: '%s'."), *argv);
 		nmc->return_value = NMC_RESULT_ERROR_USER_INPUT;
 		goto finish;
@@ -8305,8 +8345,8 @@ do_connection_delete (NmCli *nmc, int argc, char **argv)
 	ConnectionCbInfo *info = NULL;
 	GSList *queue = NULL, *iter;
 	char **arg_arr = NULL, *old_arg;
-	char **arg_ptr = argv;
-	int arg_num = argc;
+	char **arg_ptr;
+	int arg_num;
 	GString *invalid_cons = NULL;
 	int pos = 0;
 	GError *error = NULL;
@@ -8314,6 +8354,10 @@ do_connection_delete (NmCli *nmc, int argc, char **argv)
 	if (nmc->timeout == -1)
 		nmc->timeout = 10;
 
+	next_arg (nmc, &argc, &argv, NULL);
+	arg_ptr = argv;
+	arg_num = argc;
+
 	if (argc == 0) {
 		if (nmc->ask) {
 			char *line;
@@ -8444,6 +8488,7 @@ do_connection_monitor (NmCli *nmc, int argc, char **argv)
 {
 	GError *error = NULL;
 
+	next_arg (nmc, &argc, &argv, NULL);
 	if (argc == 0) {
 		/* No connections specified. Monitor all. */
 		const GPtrArray *connections;
@@ -8492,6 +8537,7 @@ do_connection_reload (NmCli *nmc, int argc, char **argv)
 {
 	GError *error = NULL;
 
+	next_arg (nmc, &argc, &argv, NULL);
 	if (nmc->complete)
 		return nmc->return_value;
 
@@ -8512,6 +8558,7 @@ do_connection_load (NmCli *nmc, int argc, char **argv)
 	char **filenames, **failures = NULL;
 	int i;
 
+	next_arg (nmc, &argc, &argv, NULL);
 	if (argc == 0) {
 		g_string_printf (nmc->return_text, _("Error: No connection specified."));
 		return NMC_RESULT_ERROR_USER_INPUT;
@@ -8547,6 +8594,22 @@ do_connection_load (NmCli *nmc, int argc, char **argv)
 #define PROMPT_IMPORT_TYPE PROMPT_VPN_TYPE
 #define PROMPT_IMPORT_FILE N_("File to import: ")
 
+static void
+nmc_complete_vpn_service (const char *prefix)
+{
+	char **services;
+	char **candidate;
+
+	services = nm_vpn_plugin_info_list_get_service_types (NULL, FALSE, TRUE);
+	for (candidate = services; *candidate; candidate++) {
+		if (!*prefix && g_str_has_prefix (*candidate, NM_DBUS_INTERFACE))
+			continue;
+		if (!*prefix || matches (prefix, *candidate))
+			g_print ("%s\n", *candidate);
+	}
+	g_strfreev (services);
+}
+
 static NMCResultCode
 do_connection_import (NmCli *nmc, int argc, char **argv)
 {
@@ -8559,6 +8622,13 @@ do_connection_import (NmCli *nmc, int argc, char **argv)
 	gs_free char *service_type = NULL;
 	gboolean temporary = FALSE;
 
+	/* Check --temporary */
+	if (next_arg (nmc, &argc, &argv, "--temporary", NULL) > 0) {
+		temporary = TRUE;
+		next_arg (nmc, &argc, &argv, NULL);
+	}
+
+
 	if (argc == 0) {
 		/* nmc_do_cmd() should not call this with argc=0. */
 		g_assert (!nmc->complete);
@@ -8577,25 +8647,29 @@ do_connection_import (NmCli *nmc, int argc, char **argv)
 
 	while (argc > 0) {
 		if (argc == 1 && nmc->complete)
-			nmc_complete_strings (*argv, "temporary", "type", "file", NULL);
-		if (nmc_arg_is_option (*argv, "temporary")) {
-			temporary = TRUE;
-			next_arg (&argc, &argv);
-		}
+			nmc_complete_strings (*argv, "type", "file", NULL);
 
 		if (strcmp (*argv, "type") == 0) {
-			if (next_arg (&argc, &argv) != 0) {
+			argc--;
+			argv++;
+			if (!argc) {
 				g_string_printf (nmc->return_text, _("Error: %s argument is missing."), *(argv-1));
 				nmc->return_value = NMC_RESULT_ERROR_USER_INPUT;
 				goto finish;
 			}
+
+			if (argc == 1 && nmc->complete)
+				nmc_complete_vpn_service (*argv);
+
 			if (!type)
 				type = *argv;
 			else
 				g_printerr (_("Warning: 'type' already specified, ignoring extra one.\n"));
 
 		} else if (strcmp (*argv, "file") == 0) {
-			if (next_arg (&argc, &argv) != 0) {
+			argc--;
+			argv++;
+			if (!argc) {
 				g_string_printf (nmc->return_text, _("Error: %s argument is missing."), *(argv-1));
 				nmc->return_value = NMC_RESULT_ERROR_USER_INPUT;
 				goto finish;
@@ -8612,8 +8686,7 @@ do_connection_import (NmCli *nmc, int argc, char **argv)
 			goto finish;
 		}
 
-		argc--;
-		argv++;
+		next_arg (nmc, &argc, &argv, NULL);
 	}
 
 	if (nmc->complete)
@@ -8689,8 +8762,12 @@ do_connection_export (NmCli *nmc, int argc, char **argv)
 	char tmpfile[] = "/tmp/nmcli-export-temp-XXXXXX";
 	char **arg_arr = NULL;
 	int arg_num;
-	char ***argv_ptr = &argv;
-	int *argc_ptr = &argc;
+	char ***argv_ptr;
+	int *argc_ptr;
+
+	next_arg (nmc, &argc, &argv, NULL);
+	argv_ptr = &argv;
+	argc_ptr = &argc;
 
 	if (argc == 0 && nmc->ask) {
 		char *line;
@@ -8715,17 +8792,17 @@ do_connection_export (NmCli *nmc, int argc, char **argv)
 	if (nmc->complete)
 		return nmc->return_value;
 
-	if (next_arg (&argc, &argv) == 0)
-		out_name = *argv;
-	else if (nmc->ask)
-		out_name = out_name_ask = nmc_readline (_("Output file name: "));
+	out_name = *argv;
 
-	if (next_arg (argc_ptr, argv_ptr) == 0) {
+	if (next_arg (nmc->ask ? NULL : nmc, argc_ptr, argv_ptr, NULL) == 0) {
 		g_string_printf (nmc->return_text, _("Error: unknown extra argument: '%s'."), *argv);
 		nmc->return_value = NMC_RESULT_ERROR_USER_INPUT;
 		goto finish;
 	}
 
+	if (out_name == NULL && nmc->ask)
+		out_name = out_name_ask = nmc_readline (_("Output file name: "));
+
 	type = nm_connection_get_connection_type (connection);
 	if (g_strcmp0 (type, NM_SETTING_VPN_SETTING_NAME) != 0) {
 		g_string_printf (nmc->return_text, _("Error: the connection is not VPN."));
@@ -8893,6 +8970,8 @@ static const NMCCommand connection_cmds[] = {
 NMCResultCode
 do_connections (NmCli *nmc, int argc, char **argv)
 {
+	next_arg (nmc, &argc, &argv, NULL);
+
 	/* Register polkit agent */
 	nmc_start_polkit_agent_start_try (nmc);
 
diff --git a/clients/cli/devices.c b/clients/cli/devices.c
index eaded0ca..387edef8 100644
--- a/clients/cli/devices.c
+++ b/clients/cli/devices.c
@@ -92,8 +92,8 @@ NmcOutputField nmc_fields_dev_show_connections[] = {
 	{"AVAILABLE-CONNECTIONS",      N_("AVAILABLE-CONNECTIONS")},       /* 2 */
 	{NULL, NULL}
 };
-#define NMC_FIELDS_DEV_SHOW_CONNECTIONS_ALL     "AVAILABLE-CONNECTION-PATHS,AVAILABLE-CONNECTIONS"
-#define NMC_FIELDS_DEV_SHOW_CONNECTIONS_COMMON  "AVAILABLE-CONNECTION-PATHS,AVAILABLE-CONNECTIONS"
+#define NMC_FIELDS_DEV_SHOW_CONNECTIONS_ALL     "NAME,AVAILABLE-CONNECTION-PATHS,AVAILABLE-CONNECTIONS"
+#define NMC_FIELDS_DEV_SHOW_CONNECTIONS_COMMON  "NAME,AVAILABLE-CONNECTION-PATHS,AVAILABLE-CONNECTIONS"
 
 /* Available fields for 'device show' - CAPABILITIES part */
 NmcOutputField nmc_fields_dev_show_cap[] = {
@@ -101,10 +101,11 @@ NmcOutputField nmc_fields_dev_show_cap[] = {
 	{"CARRIER-DETECT",  N_("CARRIER-DETECT")},  /* 1 */
 	{"SPEED",           N_("SPEED")},           /* 2 */
 	{"IS-SOFTWARE",     N_("IS-SOFTWARE")},     /* 3 */
+	{"SRIOV",           N_("SRIOV")},           /* 4 */
 	{NULL, NULL}
 };
-#define NMC_FIELDS_DEV_SHOW_CAP_ALL     "NAME,CARRIER-DETECT,SPEED,IS-SOFTWARE"
-#define NMC_FIELDS_DEV_SHOW_CAP_COMMON  "NAME,CARRIER-DETECT,SPEED,IS-SOFTWARE"
+#define NMC_FIELDS_DEV_SHOW_CAP_ALL     "NAME,CARRIER-DETECT,SPEED,IS-SOFTWARE,SRIOV"
+#define NMC_FIELDS_DEV_SHOW_CAP_COMMON  "NAME,CARRIER-DETECT,SPEED,IS-SOFTWARE,SRIOV"
 
 /* Available fields for 'device show' - wired properties part */
 NmcOutputField nmc_fields_dev_show_wired_prop[] = {
@@ -613,7 +614,7 @@ get_device_list (NmCli *nmc, int argc, char **argv)
 		}
 
 		/* Take next argument */
-		next_arg (&arg_num, &arg_ptr);
+		next_arg (nmc->ask ? NULL : nmc, &arg_num, &arg_ptr, NULL);
 	}
 	g_free (devices);
 
@@ -642,7 +643,7 @@ get_device (NmCli *nmc, int *argc, char ***argv, GError **error)
 		}
 	} else {
 		ifname = **argv;
-		next_arg (argc, argv);
+		next_arg (nmc, argc, argv, NULL);
 	}
 
 	devices = nmc_get_devices_sorted (nmc->client);
@@ -1084,7 +1085,7 @@ show_device_info (NMDevice *device, NmCli *nmc)
 
 	if (!nmc->required_fields || strcasecmp (nmc->required_fields, "common") == 0)
 		fields_str = fields_common;
-	else if (!nmc->required_fields || strcasecmp (nmc->required_fields, "all") == 0)
+	else if (strcasecmp (nmc->required_fields, "all") == 0)
 		fields_str = fields_all;
 	else
 		fields_str = nmc->required_fields;
@@ -1097,8 +1098,10 @@ show_device_info (NMDevice *device, NmCli *nmc)
 		return FALSE;
 	}
 
-	/* Main header */
+	/* Main header (pretty only) */
 	nmc->print_fields.header_name = (char *) construct_header_name (base_hdr, nm_device_get_iface (device));
+
+	/* Lazy way to retrieve sorted array from 0 to the number of dev fields */
 	nmc->print_fields.indices = parse_output_fields (NMC_FIELDS_DEV_SHOW_GENERAL_ALL,
 	                                                 nmc_fields_dev_show_general, FALSE, NULL, NULL);
 
@@ -1194,6 +1197,7 @@ show_device_info (NMDevice *device, NmCli *nmc)
 			set_val_strc (arr, 1, (caps & NM_DEVICE_CAP_CARRIER_DETECT) ? _("yes") : _("no"));
 			set_val_str  (arr, 2, speed_str);
 			set_val_strc (arr, 3, (caps & NM_DEVICE_CAP_IS_SOFTWARE) ? _("yes") : _("no"));
+			set_val_strc (arr, 4, (caps & NM_DEVICE_CAP_SRIOV) ? _("yes") : _("no"));
 			g_ptr_array_add (nmc->output_data, arr);
 
 			print_data (nmc);  /* Print all data */
@@ -1488,20 +1492,15 @@ do_devices_status (NmCli *nmc, int argc, char **argv)
 	NmcOutputField *tmpl, *arr;
 	size_t tmpl_len;
 
+	next_arg (nmc, &argc, &argv, NULL);
+
 	/* Nothing to complete */
 	if (nmc->complete)
 		return nmc->return_value;
 
-	if (!nmc_terse_option_check (nmc->print_output, nmc->required_fields, &error)) {
-		g_string_printf (nmc->return_text, _("Error: %s."), error->message);
-		g_error_free (error);
-		return NMC_RESULT_ERROR_USER_INPUT;
-	}
-
 	while (argc > 0) {
 		g_printerr (_("Unknown parameter: %s\n"), *argv);
-		argc--;
-		argv++;
+		next_arg (nmc, &argc, &argv, NULL);
 	}
 
 	if (!nmc->required_fields || strcasecmp (nmc->required_fields, "common") == 0)
@@ -1543,6 +1542,7 @@ do_device_show (NmCli *nmc, int argc, char **argv)
 {
 	gs_free_error GError *error = NULL;
 
+	next_arg (nmc, &argc, &argv, NULL);
 	if (!nmc->mode_specified)
 		nmc->multiline_output = TRUE;  /* multiline mode is default for 'device show' */
 
@@ -1835,6 +1835,7 @@ do_device_connect (NmCli *nmc, int argc, char **argv)
 	if (nmc->timeout == -1)
 		nmc->timeout = 90;
 
+	next_arg (nmc, &argc, &argv, NULL);
 	device = get_device (nmc, &argc, &argv, &error);
 	if (!device) {
 		g_string_printf (nmc->return_text, _("Error: %s."), error->message);
@@ -2003,6 +2004,7 @@ do_device_reapply (NmCli *nmc, int argc, char **argv)
 	if (nmc->timeout == -1)
 		nmc->timeout = 10;
 
+	next_arg (nmc, &argc, &argv, NULL);
 	device = get_device (nmc, &argc, &argv, &error);
 	if (!device) {
 		g_string_printf (nmc->return_text, _("Error: %s."), error->message);
@@ -2110,6 +2112,7 @@ do_device_modify (NmCli *nmc, int argc, char **argv)
 	ModifyInfo *info = NULL;
 	gs_free_error GError *error = NULL;
 
+	next_arg (nmc, &argc, &argv, NULL);
 	device = get_device (nmc, &argc, &argv, &error);
 	if (!device) {
 		g_string_printf (nmc->return_text, _("Error: %s."), error->message);
@@ -2176,6 +2179,7 @@ do_devices_disconnect (NmCli *nmc, int argc, char **argv)
 	if (nmc->timeout == -1)
 		nmc->timeout = 10;
 
+	next_arg (nmc, &argc, &argv, NULL);
 	queue = get_device_list (nmc, argc, argv);
 	if (!queue)
 		return nmc->return_value;
@@ -2245,6 +2249,7 @@ do_devices_delete (NmCli *nmc, int argc, char **argv)
 	if (nmc->timeout == -1)
 		nmc->timeout = 10;
 
+	next_arg (nmc, &argc, &argv, NULL);
 	queue = get_device_list (nmc, argc, argv);
 	if (!queue)
 		return nmc->return_value;
@@ -2293,10 +2298,9 @@ do_device_set (NmCli *nmc, int argc, char **argv)
 	};
 	gs_free_error GError *error = NULL;
 
-	if (argc >= 1 && g_strcmp0 (*argv, "ifname") == 0) {
-		argc--;
-		argv++;
-	}
+	next_arg (nmc, &argc, &argv, NULL);
+	if (argc >= 1 && g_strcmp0 (*argv, "ifname") == 0)
+		next_arg (nmc, &argc, &argv, NULL);
 
 	device = get_device (nmc, &argc, &argv, &error);
 	if (!device) {
@@ -2316,8 +2320,10 @@ do_device_set (NmCli *nmc, int argc, char **argv)
 		if (argc == 1 && nmc->complete)
 			nmc_complete_strings (*argv, "managed", "autoconnect", NULL);
 
-		if (matches (*argv, "managed") == 0) {
-			if (next_arg (&argc, &argv) != 0) {
+		if (matches (*argv, "managed")) {
+			argc--;
+			argv++;
+			if (!argc) {
 				g_string_printf (nmc->return_text, _("Error: '%s' argument is missing."), *(argv-1));
 				return NMC_RESULT_ERROR_USER_INPUT;
 			}
@@ -2331,8 +2337,10 @@ do_device_set (NmCli *nmc, int argc, char **argv)
 			values[DEV_SET_MANAGED].idx = ++i;
 			values[DEV_SET_MANAGED].value = flag;
 		}
-		else if (matches (*argv, "autoconnect") == 0) {
-			if (next_arg (&argc, &argv) != 0) {
+		else if (matches (*argv, "autoconnect")) {
+			argc--;
+			argv++;
+			if (!argc) {
 				g_string_printf (nmc->return_text, _("Error: '%s' argument is missing."), *(argv-1));
 				return NMC_RESULT_ERROR_USER_INPUT;
 			}
@@ -2350,7 +2358,7 @@ do_device_set (NmCli *nmc, int argc, char **argv)
 			g_string_printf (nmc->return_text, _("Error: property '%s' is not known."), *argv);
 			return NMC_RESULT_ERROR_USER_INPUT;
 		}
-	} while (next_arg (&argc, &argv) == 0);
+	} while (next_arg (nmc, &argc, &argv, NULL) == 0);
 
 	if (nmc->complete)
 		return nmc->return_value;
@@ -2437,12 +2445,10 @@ device_removed (NMClient *client, NMDevice *device, NmCli *nmc)
 static NMCResultCode
 do_devices_monitor (NmCli *nmc, int argc, char **argv)
 {
-	GSList *queue = get_device_list (nmc, argc, argv);
-	GSList *iter;
-
 	if (nmc->complete)
 		return nmc->return_value;
 
+	next_arg (nmc, &argc, &argv, NULL);
 	if (argc == 0) {
 		/* No devices specified. Monitor all. */
 		const GPtrArray *devices = nm_client_get_devices (nmc->client);
@@ -2455,6 +2461,9 @@ do_devices_monitor (NmCli *nmc, int argc, char **argv)
 		nmc->should_wait++;
 		g_signal_connect (nmc->client, NM_CLIENT_DEVICE_ADDED, G_CALLBACK (device_added), nmc);
 	} else {
+		GSList *queue = get_device_list (nmc, argc, argv);
+		GSList *iter;
+
 		/* Monitor the specified devices. */
 		for (iter = queue; iter; iter = g_slist_next (iter))
 			device_watch (nmc, NM_DEVICE (iter->data));
@@ -2631,12 +2640,15 @@ do_device_wifi_list (NmCli *nmc, int argc, char **argv)
 
 	devices = nmc_get_devices_sorted (nmc->client);
 
+	next_arg (nmc, &argc, &argv, NULL);
 	while (argc > 0) {
 		if (argc == 1 && nmc->complete)
 			nmc_complete_strings (*argv, "ifname", "bssid", NULL);
 
 		if (strcmp (*argv, "ifname") == 0) {
-			if (next_arg (&argc, &argv) != 0) {
+			argc--;
+			argv++;
+			if (!argc) {
 				g_string_printf (nmc->return_text, _("Error: %s argument is missing."), *(argv-1));
 				return NMC_RESULT_ERROR_USER_INPUT;
 			}
@@ -2644,7 +2656,9 @@ do_device_wifi_list (NmCli *nmc, int argc, char **argv)
 			complete_device (devices, ifname, TRUE);
 		} else if (strcmp (*argv, "bssid") == 0 || strcmp (*argv, "hwaddr") == 0) {
 			/* hwaddr is deprecated and will be removed later */
-			if (next_arg (&argc, &argv) != 0) {
+			argc--;
+			argv++;
+			if (!argc) {
 				g_string_printf (nmc->return_text, _("Error: %s argument is missing."), *(argv-1));
 				return NMC_RESULT_ERROR_USER_INPUT;
 			}
@@ -2655,8 +2669,7 @@ do_device_wifi_list (NmCli *nmc, int argc, char **argv)
 			g_printerr (_("Unknown parameter: %s\n"), *argv);
 		}
 
-		argc--;
-		argv++;
+		next_arg (nmc, &argc, &argv, NULL);
 	}
 
 	if (!nmc->required_fields || strcasecmp (nmc->required_fields, "common") == 0)
@@ -2845,6 +2858,7 @@ do_device_wifi_connect_network (NmCli *nmc, int argc, char **argv)
 
 	devices = nmc_get_devices_sorted (nmc->client);
 
+	next_arg (nmc, &argc, &argv, NULL);
 	/* Get the first compulsory argument (SSID or BSSID) */
 	if (argc > 0) {
 		param_user = *argv;
@@ -2853,8 +2867,7 @@ do_device_wifi_connect_network (NmCli *nmc, int argc, char **argv)
 		if (argc == 1 && nmc->complete)
 			complete_aps (devices, NULL, param_user, param_user);
 
-		argc--;
-		argv++;
+		next_arg (nmc, &argc, &argv, NULL);
 	} else {
 		/* nmc_do_cmd() should not call this with argc=0. */
 		g_assert (!nmc->complete);
@@ -2879,7 +2892,9 @@ do_device_wifi_connect_network (NmCli *nmc, int argc, char **argv)
 		}
 
 		if (strcmp (*argv, "ifname") == 0) {
-			if (next_arg (&argc, &argv) != 0) {
+			argc--;
+			argv++;
+			if (!argc) {
 				g_string_printf (nmc->return_text, _("Error: %s argument is missing."), *(argv-1));
 				nmc->return_value = NMC_RESULT_ERROR_USER_INPUT;
 				goto finish;
@@ -2887,7 +2902,9 @@ do_device_wifi_connect_network (NmCli *nmc, int argc, char **argv)
 			ifname = *argv;
 			complete_device (devices, ifname, TRUE);
 		} else if (strcmp (*argv, "bssid") == 0) {
-			if (next_arg (&argc, &argv) != 0) {
+			argc--;
+			argv++;
+			if (!argc) {
 				g_string_printf (nmc->return_text, _("Error: %s argument is missing."), *(argv-1));
 				nmc->return_value = NMC_RESULT_ERROR_USER_INPUT;
 				goto finish;
@@ -2903,14 +2920,18 @@ do_device_wifi_connect_network (NmCli *nmc, int argc, char **argv)
 				goto finish;
 			}
 		} else if (strcmp (*argv, "password") == 0) {
-			if (next_arg (&argc, &argv) != 0) {
+			argc--;
+			argv++;
+			if (!argc) {
 				g_string_printf (nmc->return_text, _("Error: %s argument is missing."), *(argv-1));
 				nmc->return_value = NMC_RESULT_ERROR_USER_INPUT;
 				goto finish;
 			}
 			password = *argv;
 		} else if (strcmp (*argv, "wep-key-type") == 0) {
-			if (next_arg (&argc, &argv) != 0) {
+			argc--;
+			argv++;
+			if (!argc) {
 				g_string_printf (nmc->return_text, _("Error: %s argument is missing."), *(argv-1));
 				nmc->return_value = NMC_RESULT_ERROR_USER_INPUT;
 				goto finish;
@@ -2929,7 +2950,9 @@ do_device_wifi_connect_network (NmCli *nmc, int argc, char **argv)
 				goto finish;
 			}
 		} else if (strcmp (*argv, "name") == 0) {
-			if (next_arg (&argc, &argv) != 0) {
+			argc--;
+			argv++;
+			if (!argc) {
 				g_string_printf (nmc->return_text, _("Error: %s argument is missing."), *(argv-1));
 				nmc->return_value = NMC_RESULT_ERROR_USER_INPUT;
 				goto finish;
@@ -2937,7 +2960,10 @@ do_device_wifi_connect_network (NmCli *nmc, int argc, char **argv)
 			con_name = *argv;
 		} else if (strcmp (*argv, "private") == 0) {
 			GError *err_tmp = NULL;
-			if (next_arg (&argc, &argv) != 0) {
+
+			argc--;
+			argv++;
+			if (!argc) {
 				g_string_printf (nmc->return_text, _("Error: %s argument is missing."), *(argv-1));
 				nmc->return_value = NMC_RESULT_ERROR_USER_INPUT;
 				goto finish;
@@ -2952,7 +2978,10 @@ do_device_wifi_connect_network (NmCli *nmc, int argc, char **argv)
 			}
 		} else if (strcmp (*argv, "hidden") == 0) {
 			GError *err_tmp = NULL;
-			if (next_arg (&argc, &argv) != 0) {
+
+			argc--;
+			argv++;
+			if (!argc) {
 				g_string_printf (nmc->return_text, _("Error: %s argument is missing."), *(argv-1));
 				nmc->return_value = NMC_RESULT_ERROR_USER_INPUT;
 				goto finish;
@@ -2969,8 +2998,7 @@ do_device_wifi_connect_network (NmCli *nmc, int argc, char **argv)
 			g_printerr (_("Unknown parameter: %s\n"), *argv);
 		}
 
-		argc--;
-		argv++;
+		next_arg (nmc, &argc, &argv, NULL);
 	}
 
 	if (nmc->complete)
@@ -3064,7 +3092,7 @@ do_device_wifi_connect_network (NmCli *nmc, int argc, char **argv)
 		if (con_name)
 			g_object_set (s_con, NM_SETTING_CONNECTION_ID, con_name, NULL);
 
-		/* Connection will only be visible to this user when '--private' is specified */
+		/* Connection will only be visible to this user when 'private' is specified */
 		if (private)
 			nm_setting_connection_add_permission (s_con, "user", g_get_user_name (), NULL);
 	}
@@ -3321,6 +3349,7 @@ do_device_wifi_hotspot (NmCli *nmc, int argc, char **argv)
 
 	devices = nmc_get_devices_sorted (nmc->client);
 
+	next_arg (nmc, &argc, &argv, NULL);
 	while (argc > 0) {
 		if (argc == 1 && nmc->complete) {
 			nmc_complete_strings (*argv, "ifname", "con-name", "ssid", "band",
@@ -3328,7 +3357,9 @@ do_device_wifi_hotspot (NmCli *nmc, int argc, char **argv)
 		}
 
 		if (strcmp (*argv, "ifname") == 0) {
-			if (next_arg (&argc, &argv) != 0) {
+			argc--;
+			argv++;
+			if (!argc) {
 				g_string_printf (nmc->return_text, _("Error: %s argument is missing."), *(argv-1));
 				return NMC_RESULT_ERROR_USER_INPUT;
 			}
@@ -3336,13 +3367,17 @@ do_device_wifi_hotspot (NmCli *nmc, int argc, char **argv)
 			if (argc == 1 && nmc->complete)
 				complete_device (devices, ifname, TRUE);
 		} else if (strcmp (*argv, "con-name") == 0) {
-			if (next_arg (&argc, &argv) != 0) {
+			argc--;
+			argv++;
+			if (!argc) {
 				g_string_printf (nmc->return_text, _("Error: %s argument is missing."), *(argv-1));
 				return NMC_RESULT_ERROR_USER_INPUT;
 			}
 			con_name = *argv;
 		} else if (strcmp (*argv, "ssid") == 0) {
-			if (next_arg (&argc, &argv) != 0) {
+			argc--;
+			argv++;
+			if (!argc) {
 				g_string_printf (nmc->return_text, _("Error: %s argument is missing."), *(argv-1));
 				return NMC_RESULT_ERROR_USER_INPUT;
 			}
@@ -3352,7 +3387,9 @@ do_device_wifi_hotspot (NmCli *nmc, int argc, char **argv)
 				return NMC_RESULT_ERROR_USER_INPUT;
 			}
 		} else if (strcmp (*argv, "band") == 0) {
-			if (next_arg (&argc, &argv) != 0) {
+			argc--;
+			argv++;
+			if (!argc) {
 				g_string_printf (nmc->return_text, _("Error: %s argument is missing."), *(argv-1));
 				return NMC_RESULT_ERROR_USER_INPUT;
 			}
@@ -3365,13 +3402,17 @@ do_device_wifi_hotspot (NmCli *nmc, int argc, char **argv)
 				return NMC_RESULT_ERROR_USER_INPUT;
 			}
 		} else if (strcmp (*argv, "channel") == 0) {
-			if (next_arg (&argc, &argv) != 0) {
+			argc--;
+			argv++;
+			if (!argc) {
 				g_string_printf (nmc->return_text, _("Error: %s argument is missing."), *(argv-1));
 				return NMC_RESULT_ERROR_USER_INPUT;
 			}
 			channel = *argv;
 		} else if (strcmp (*argv, "password") == 0) {
-			if (next_arg (&argc, &argv) != 0) {
+			argc--;
+			argv++;
+			if (!argc) {
 				g_string_printf (nmc->return_text, _("Error: %s argument is missing."), *(argv-1));
 				return NMC_RESULT_ERROR_USER_INPUT;
 			}
@@ -3385,8 +3426,7 @@ do_device_wifi_hotspot (NmCli *nmc, int argc, char **argv)
 			return NMC_RESULT_ERROR_USER_INPUT;
 		}
 
-		argc--;
-		argv++;
+		next_arg (nmc, &argc, &argv, NULL);
 	}
 	show_password = nmc->show_secrets || show_password;
 
@@ -3532,6 +3572,7 @@ do_device_wifi_rescan (NmCli *nmc, int argc, char **argv)
 	ssids = g_ptr_array_new ();
 	devices = nmc_get_devices_sorted (nmc->client);
 
+	next_arg (nmc, &argc, &argv, NULL);
 	/* Get the parameters */
 	while (argc > 0) {
 		if (argc == 1 && nmc->complete)
@@ -3543,7 +3584,9 @@ do_device_wifi_rescan (NmCli *nmc, int argc, char **argv)
 				nmc->return_value = NMC_RESULT_ERROR_USER_INPUT;
 				goto finish;
 			}
-			if (next_arg (&argc, &argv) != 0) {
+			argc--;
+			argv++;
+			if (!argc) {
 				g_string_printf (nmc->return_text, _("Error: %s argument is missing."), *(argv-1));
 				nmc->return_value = NMC_RESULT_ERROR_USER_INPUT;
 				goto finish;
@@ -3552,7 +3595,9 @@ do_device_wifi_rescan (NmCli *nmc, int argc, char **argv)
 			if (argc == 1 && nmc->complete)
 				complete_device (devices, ifname, TRUE);
 		} else if (strcmp (*argv, "ssid") == 0) {
-			if (next_arg (&argc, &argv) != 0) {
+			argc--;
+			argv++;
+			if (!argc) {
 				g_string_printf (nmc->return_text, _("Error: %s argument is missing."), *(argv-1));
 				nmc->return_value = NMC_RESULT_ERROR_USER_INPUT;
 				goto finish;
@@ -3561,8 +3606,7 @@ do_device_wifi_rescan (NmCli *nmc, int argc, char **argv)
 		} else if (!nmc->complete)
 			g_printerr (_("Unknown parameter: %s\n"), *argv);
 
-		argc--;
-		argv++;
+		next_arg (nmc, &argc, &argv, NULL);
 	}
 
 	if (nmc->complete)
@@ -3617,14 +3661,7 @@ static NMCCommand device_wifi_cmds[] = {
 static NMCResultCode
 do_device_wifi (NmCli *nmc, int argc, char **argv)
 {
-	GError *error = NULL;
-
-	if (!nmc_terse_option_check (nmc->print_output, nmc->required_fields, &error)) {
-		g_string_printf (nmc->return_text, _("Error: %s."), error->message);
-		g_error_free (error);
-		return NMC_RESULT_ERROR_USER_INPUT;
-	}
-
+	next_arg (nmc, &argc, &argv, NULL);
 	nmc_do_cmd (nmc, device_wifi_cmds, *argv, argc, argv);
 
 	return nmc->return_value;
@@ -3722,12 +3759,15 @@ do_device_lldp_list (NmCli *nmc, int argc, char **argv)
 	char *fields_str;
 	int counter = 0;
 
+	next_arg (nmc, &argc, &argv, NULL);
 	while (argc > 0) {
 		if (argc == 1 && nmc->complete)
 			nmc_complete_strings (*argv, "ifname", NULL);
 
 		if (strcmp (*argv, "ifname") == 0) {
-			if (next_arg (&argc, &argv) != 0) {
+			argc--;
+			argv++;
+			if (!argc) {
 				g_string_printf (nmc->return_text, _("Error: %s argument is missing."), *(argv-1));
 				return NMC_RESULT_ERROR_USER_INPUT;
 			}
@@ -3742,8 +3782,7 @@ do_device_lldp_list (NmCli *nmc, int argc, char **argv)
 			return NMC_RESULT_ERROR_USER_INPUT;
 		}
 
-		argc--;
-		argv++;
+		next_arg (nmc, &argc, &argv, NULL);
 	}
 
 	if (!nmc->required_fields || strcasecmp (nmc->required_fields, "common") == 0)
@@ -3789,17 +3828,10 @@ static NMCCommand device_lldp_cmds[] = {
 static NMCResultCode
 do_device_lldp (NmCli *nmc, int argc, char **argv)
 {
-	GError *error = NULL;
-
-	if (!nmc_terse_option_check (nmc->print_output, nmc->required_fields, &error)) {
-		g_string_printf (nmc->return_text, _("Error: %s."), error->message);
-		g_error_free (error);
-		return NMC_RESULT_ERROR_USER_INPUT;
-	}
-
 	if (!nmc->mode_specified)
 		nmc->multiline_output = TRUE;  /* multiline mode is default for 'device lldp' */
 
+	next_arg (nmc, &argc, &argv, NULL);
 	nmc_do_cmd (nmc, device_lldp_cmds, *argv, argc, argv);
 
 	return nmc->return_value;
@@ -3865,6 +3897,8 @@ static const NMCCommand device_cmds[] = {
 NMCResultCode
 do_devices (NmCli *nmc, int argc, char **argv)
 {
+	next_arg (nmc, &argc, &argv, NULL);
+
 	/* Register polkit agent */
 	nmc_start_polkit_agent_start_try (nmc);
 
diff --git a/clients/cli/general.c b/clients/cli/general.c
index 512ec291..12e76efd 100644
--- a/clients/cli/general.c
+++ b/clients/cli/general.c
@@ -385,13 +385,7 @@ show_nm_status (NmCli *nmc, const char *pretty_header_name, const char *print_fl
 static NMCResultCode
 do_general_status (NmCli *nmc, int argc, char **argv)
 {
-	gs_free_error GError *error = NULL;
-
-        if (!nmc_terse_option_check (nmc->print_output, nmc->required_fields, &error)) {
-                g_string_printf (nmc->return_text, _("Error: %s."), error->message);
-                return NMC_RESULT_ERROR_USER_INPUT;
-	}
-
+	next_arg (nmc, &argc, &argv, NULL);
 	if (nmc->complete)
 		return nmc->return_value;
 
@@ -566,13 +560,7 @@ show_nm_permissions (NmCli *nmc)
 static NMCResultCode
 do_general_permissions (NmCli *nmc, int argc, char **argv)
 {
-	gs_free_error GError *error = NULL;
-
-        if (!nmc_terse_option_check (nmc->print_output, nmc->required_fields, &error)) {
-                g_string_printf (nmc->return_text, _("Error: %s."), error->message);
-                return NMC_RESULT_ERROR_USER_INPUT;
-	}
-
+	next_arg (nmc, &argc, &argv, NULL);
 	if (nmc->complete)
 		return nmc->return_value;
 
@@ -632,18 +620,30 @@ show_general_logging (NmCli *nmc)
 	return TRUE;
 }
 
+static void
+nmc_complete_strings_nocase (const char *prefix, ...)
+{
+	va_list args;
+	const char *candidate;
+	int len;
+
+	len = strlen (prefix);
+
+	va_start (args, prefix);
+	while ((candidate = va_arg (args, const char *))) {
+		if (strncasecmp (prefix, candidate, len) == 0)
+			g_print ("%s\n", candidate);
+	}
+	va_end (args);
+}
+
 static NMCResultCode
 do_general_logging (NmCli *nmc, int argc, char **argv)
 {
 	gs_free_error GError *error = NULL;
 
+	next_arg (nmc, &argc, &argv, NULL);
 	if (argc == 0) {
-		if (!nmc_terse_option_check (nmc->print_output, nmc->required_fields, &error)) {
-			g_string_printf (nmc->return_text, _("Error: %s."), error->message);
-			g_error_free (error);
-			return NMC_RESULT_ERROR_USER_INPUT;
-		}
-
 		if (nmc->complete)
 			return nmc->return_value;
 
@@ -652,19 +652,49 @@ do_general_logging (NmCli *nmc, int argc, char **argv)
 		/* arguments provided -> set logging level and domains */
 		const char *level = NULL;
 		const char *domains = NULL;
-		nmc_arg_t exp_args[] = { {"level",   TRUE, &level,   TRUE},
-		                         {"domains", TRUE, &domains, TRUE},
-		                         {NULL} };
 
-		/* TODO: nmc_parse_args needs completion */
+		do {
+			if (argc == 1 && nmc->complete)
+				nmc_complete_strings (*argv, "level", "domains", NULL);
+
+			if (matches (*argv, "level")) {
+				argc--;
+				argv++;
+				if (!argc) {
+					g_string_printf (nmc->return_text, _("Error: '%s' argument is missing."), *(argv-1));
+					return NMC_RESULT_ERROR_USER_INPUT;
+				}
+				if (argc == 1 && nmc->complete) {
+					nmc_complete_strings_nocase (*argv, "TRACE", "DEBUG", "INFO", "WARN",
+					                             "ERR", "OFF", "KEEP", NULL);
+				}
+				level = *argv;
+			} else if (matches (*argv, "domains")) {
+				argc--;
+				argv++;
+				if (!argc) {
+					g_string_printf (nmc->return_text, _("Error: '%s' argument is missing."), *(argv-1));
+					return NMC_RESULT_ERROR_USER_INPUT;
+				}
+				if (argc == 1 && nmc->complete) {
+					nmc_complete_strings_nocase (*argv, "PLATFORM", "RFKILL", "ETHER", "WIFI", "BT",
+					                             "MB", "DHCP4", "DHCP6", "PPP", "WIFI_SCAN", "IP4",
+					                             "IP6", "AUTOIP4", "DNS", "VPN", "SHARING", "SUPPLICANT",
+					                             "AGENTS", "SETTINGS", "SUSPEND", "CORE", "DEVICE", "OLPC",
+					                             "INFINIBAND", "FIREWALL", "ADSL", "BOND", "VLAN", "BRIDGE",
+					                             "DBUS_PROPS", "TEAM", "CONCHECK", "DCB", "DISPATCH", "AUDIT",
+					                             "SYSTEMD", "VPN_PLUGIN", "PROXY", NULL);
+				}
+				domains = *argv;
+			} else {
+				g_string_printf (nmc->return_text, _("Error: property '%s' is not known."), *argv);
+				return NMC_RESULT_ERROR_USER_INPUT;
+			}
+		} while (next_arg (nmc, &argc, &argv, NULL) == 0);
+
 		if (nmc->complete)
 			return nmc->return_value;
 
-		if (!nmc_parse_args (exp_args, FALSE, &argc, &argv, &error)) {
-			g_string_assign (nmc->return_text, error->message);
-			return error->code;
-		}
-
 		nm_client_set_logging (nmc->client, level, domains, &error);
 		if (error) {
 			g_string_printf (nmc->return_text, _("Error: failed to set logging: %s"),
@@ -695,6 +725,7 @@ save_hostname_cb (GObject *object, GAsyncResult *result, gpointer user_data)
 static NMCResultCode
 do_general_hostname (NmCli *nmc, int argc, char **argv)
 {
+	next_arg (nmc, &argc, &argv, NULL);
 	if (nmc->complete)
 		return nmc->return_value;
 
@@ -710,7 +741,7 @@ do_general_hostname (NmCli *nmc, int argc, char **argv)
 		/* hostname provided -> set it */
 		const char *hostname = *argv;
 
-		if (next_arg (&argc, &argv) == 0)
+		if (next_arg (nmc, &argc, &argv, NULL) == 0)
 			g_print ("Warning: ignoring extra garbage after '%s' hostname\n", hostname);
 
 		nmc->should_wait++;
@@ -735,6 +766,8 @@ static const NMCCommand general_cmds[] = {
 NMCResultCode
 do_general (NmCli *nmc, int argc, char **argv)
 {
+	next_arg (nmc, &argc, &argv, NULL);
+
 	/* Register polkit agent */
 	nmc_start_polkit_agent_start_try (nmc);
 
@@ -800,18 +833,21 @@ do_networking_on_off (NmCli *nmc, int argc, char **argv, gboolean enable)
 static NMCResultCode
 do_networking_on (NmCli *nmc, int argc, char **argv)
 {
+	next_arg (nmc, &argc, &argv, NULL);
 	return do_networking_on_off (nmc, argc, argv, TRUE);
 }
 
 static NMCResultCode
 do_networking_off (NmCli *nmc, int argc, char **argv)
 {
+	next_arg (nmc, &argc, &argv, NULL);
 	return do_networking_on_off (nmc, argc, argv, FALSE);
 }
 
 static NMCResultCode
 do_networking_connectivity (NmCli *nmc, int argc, char **argv)
 {
+	next_arg (nmc, &argc, &argv, NULL);
 	if (nmc->complete) {
 		if (argc == 1)
 			nmc_complete_strings (*argv, "check", NULL);
@@ -821,7 +857,7 @@ do_networking_connectivity (NmCli *nmc, int argc, char **argv)
 	if (!argc) {
 		/* no arguments -> get current state */
 		nmc_switch_show (nmc, NMC_FIELDS_NM_CONNECTIVITY, _("Connectivity"));
-	} else if (matches (*argv, "check") == 0) {
+	} else if (matches (*argv, "check")) {
 		gs_free_error GError *error = NULL;
 
 		/* Register polkit agent */
@@ -845,6 +881,7 @@ do_networking_connectivity (NmCli *nmc, int argc, char **argv)
 static NMCResultCode
 do_networking_show (NmCli *nmc, int argc, char **argv)
 {
+	next_arg (nmc, &argc, &argv, NULL);
 	if (nmc->complete)
 		return nmc->return_value;
 
@@ -866,6 +903,7 @@ static const NMCCommand networking_cmds[] = {
 NMCResultCode
 do_networking (NmCli *nmc, int argc, char **argv)
 {
+	next_arg (nmc, &argc, &argv, NULL);
 	nmc_do_cmd (nmc, networking_cmds, *argv, argc, argv);
 
 	return nmc->return_value;
@@ -875,17 +913,13 @@ static NMCResultCode
 do_radio_all (NmCli *nmc, int argc, char **argv)
 {
 	gboolean enable_flag;
-	gs_free_error GError *error = NULL;
 
+	next_arg (nmc, &argc, &argv, NULL);
 	if (argc == 0) {
 		if (nmc->complete)
 			return nmc->return_value;
 
 		/* no argument, show all radio switches */
-		if (!nmc_terse_option_check (nmc->print_output, nmc->required_fields, &error)) {
-			g_string_printf (nmc->return_text, _("Error: %s."), error->message);
-			return NMC_RESULT_ERROR_USER_INPUT;
-		}
 		show_nm_status (nmc, _("Radio switches"), NMC_FIELDS_NM_STATUS_RADIO);
 	} else {
 		if (nmc->complete) {
@@ -910,6 +944,7 @@ do_radio_wifi (NmCli *nmc, int argc, char **argv)
 {
 	gboolean enable_flag;
 
+	next_arg (nmc, &argc, &argv, NULL);
 	if (argc == 0) {
 		if (nmc->complete)
 			return nmc->return_value;
@@ -936,6 +971,7 @@ do_radio_wwan (NmCli *nmc, int argc, char **argv)
 {
 	gboolean enable_flag;
 
+	next_arg (nmc, &argc, &argv, NULL);
 	if (argc == 0) {
 		if (nmc->complete)
 			return nmc->return_value;
@@ -970,6 +1006,8 @@ static const NMCCommand radio_cmds[] = {
 NMCResultCode
 do_radio (NmCli *nmc, int argc, char **argv)
 {
+	next_arg (nmc, &argc, &argv, NULL);
+
 	/* Register polkit agent */
 	nmc_start_polkit_agent_start_try (nmc);
 
@@ -1124,7 +1162,7 @@ ac_overview (NmCli *nmc, NMActiveConnection *ac)
 	NMIPConfig *ip;
 
 	if (nm_active_connection_get_master (ac)) {
-		g_string_append_printf (outbuf, "%s %s,", _("master"),
+		g_string_append_printf (outbuf, "%s %s, ", _("master"),
 		                        nm_device_get_iface (nm_active_connection_get_master (ac)));
 	}
 	if (nm_active_connection_get_vpn (ac))
@@ -1195,6 +1233,8 @@ do_overview (NmCli *nmc, int argc, char **argv)
 	char *tmp;
 	int i;
 
+	next_arg (nmc, &argc, &argv, NULL);
+
 	/* Register polkit agent */
 	nmc_start_polkit_agent_start_try (nmc);
 
@@ -1294,6 +1334,8 @@ do_overview (NmCli *nmc, int argc, char **argv)
 NMCResultCode
 do_monitor (NmCli *nmc, int argc, char **argv)
 {
+	next_arg (nmc, &argc, &argv, NULL);
+
 	if (nmc->complete)
 		return nmc->return_value;
 
diff --git a/clients/cli/nmcli-completion b/clients/cli/nmcli-completion
index e1716f60..45dfe89c 100644
--- a/clients/cli/nmcli-completion
+++ b/clients/cli/nmcli-completion
@@ -1,16 +1,65 @@
-# nmcli(1) completion                                      -*- shell-script -*-
-# Originally based on
-# https://github.com/GArik/bash-completion/blob/master/completions/nmcli
+# nmcli(1) completion
 
-_nmcli_list()
+_nmcli_array_delete_at()
 {
-    COMPREPLY=( $( compgen -W '$1' -- $cur ) )
+    eval "local ARRAY=(\"\${$1[@]}\")"
+    local i
+    local tmp=()
+    local lower=$2
+    local upper=${3:-$lower}
+
+    # for some reason the following fails. So this clumsy workaround...
+    #   A=(a "")
+    #   echo " >> ${#A[@]}"
+    #    >> 2
+    #   A=("${A[@]:1}")
+    #   echo " >> ${#A[@]}"
+    #    >> 0
+    # ... seriously???
+
+    for i in "${!ARRAY[@]}"; do
+        if [[ "$i" -lt "$2" || "$i" -gt "${3-$2}" ]]; then
+            tmp=("${tmp[@]}" "${ARRAY[$i]}")
+        fi
+    done
+    eval "$1=(\"\${tmp[@]}\")"
 }
 
-_nmcli_list_nl()
+_nmcli()
 {
+    local cur words cword i output
+    _init_completion || return
+
+    # we don't care about any arguments after the current cursor position
+    # because we only parse from left to right. So, if there are some arguments
+    # right of the cursor, just ignore them. Also don't care about ${words[0]}.
+    _nmcli_array_delete_at words $((cword+1)) ${#words[@]}
+    _nmcli_array_delete_at words 0
+
+    # _init_completion returns the words with all the quotes and escaping
+    # characters. We don't care about them, drop them at first.
+    for i in ${!words[@]}; do
+        words[i]="$(printf '%s' "${words[i]}" | xargs printf '%s\n' 2>/dev/null || true)"
+    done
+
+    # In case the cursor is not at the end of the line,
+    # $cur consists of spaces that we want do remove.
+    # For example: `nmcli connection modify id  <TAB>  lo`
+    if [[ "$cur" =~ ^[[:space:]]+ ]]; then
+        cur=''
+    fi
+
+    output="$(nmcli --complete-args "${words[@]}" 2>/dev/null)"
+
+    # Bail out early if we're completing a file name
+    if [ $? = 65 ]; then
+        compopt -o default
+        COMPREPLY=()
+        return 0
+    fi
+
     local IFS=$'\n'
-    COMPREPLY=( $( compgen -W '$1' -- $cur ) )
+    COMPREPLY=( $( compgen -W '$output' -- $cur ) )
 
     # Now escape special characters (spaces, single and double quotes),
     # so that the argument is really regarded a single argument by bash.
@@ -25,7 +74,7 @@ _nmcli_list_nl()
             # [']bla'bla"bla\bla bla --> [']bla'\''bla"bla\bla bla
             COMPREPLY[$i]="${entry//\'/${escaped_single_quote}}"
         elif [[ "${cur:0:1}" == '"' ]]; then
-            # started with double quote, escaping all double quotes, backslashes and !
+            # started with double quote, escaping all double quotes and all backslashes
             # ["]bla'bla"bla\bla bla --> ["]bla'bla\"bla\\bla bla
             entry="${entry//\\/\\\\}"
             entry="${entry//\"/\\\"}"
@@ -60,1239 +109,7 @@ _nmcli_list_nl()
         COMPREPLY[$i]=${entry}
         (( i++ ))
     done
-}
-
-_nmcli_con_show()
-{
-    nmcli -t -f "$1" connection show $2 2> /dev/null
-}
-
-_nmcli_wifi_list()
-{
-    nmcli -t -f "$1" device wifi list 2>/dev/null
-}
-
-_nmcli_dev_status()
-{
-    nmcli -t -f "$1" device status 2>/dev/null
-}
-
-_nmcli_array_has_value() {
-    # expects the name of an array as first parameter and
-    # returns true if if one of the remaining arguments is
-    # contained in the array ${$1[@]}
-    eval "local ARRAY=(\"\${$1[@]}\")"
-    local arg a
-    shift
-    for arg; do
-        for a in "${ARRAY[@]}"; do
-            if [[ "$a" = "$arg" ]]; then
-                return 0
-            fi
-        done
-    done
-    return 1
-}
-
-_nmcli_array_delete_at()
-{
-    eval "local ARRAY=(\"\${$1[@]}\")"
-    local i
-    local tmp=()
-    local lower=$2
-    local upper=${3:-$lower}
-
-    # for some reason the following fails. So this clumsy workaround...
-    #   A=(a "")
-    #   echo " >> ${#A[@]}"
-    #    >> 2
-    #   A=("${A[@]:1}")
-    #   echo " >> ${#A[@]}"
-    #    >> 0
-    # ... seriously???
-
-    for i in "${!ARRAY[@]}"; do
-        if [[ "$i" -lt "$2" || "$i" -gt "${3-$2}" ]]; then
-            tmp=("${tmp[@]}" "${ARRAY[$i]}")
-        fi
-    done
-    eval "$1=(\"\${tmp[@]}\")"
-}
-
-_nmcli_compl_match_option()
-{
-    local S="$1"
-    local V
-    shift
-    if [[ "${S:0:2}" == "--" ]]; then
-        S="${S:2}"
-    elif [[ "${S:0:1}" == "-" ]]; then
-        S="${S:1}"
-    else
-        return 1
-    fi
-    for V; do
-        case "$V" in
-            "$S"*)
-                printf "%s" "$V"
-                return 0
-                ;;
-        esac
-    done
-    return 1
-}
-
-# OPTIONS appear first at the command line (before the OBJECT).
-# This iterates over the argument list and tries to complete
-# the options. If there are options that are to be completed,
-# zero is returned and completion will be performed.
-# Otherwise it will remove all the option parameters from the ${words[@]}
-# array and return with zero (so that completion of OBJECT can continue).
-_nmcli_compl_OPTIONS()
-{
-    local i W
-
-    for (( ; ; )); do
-        if [[ "${#words[@]}" -le 1 ]]; then
-            return 1
-        fi
-        W="$(_nmcli_compl_match_option "${words[0]}" "${LONG_OPTIONS[@]}")"
-        if [[ $? != 0 ]]; then
-            return 2
-        fi
-
-        # remove the options already seen.
-        for i in ${!LONG_OPTIONS[@]}; do
-            if [[ "${LONG_OPTIONS[$i]}" == "$W" ]]; then
-                _nmcli_array_delete_at LONG_OPTIONS $i
-                break
-            fi
-        done
-
-        if [[ "$HELP_ONLY_AS_FIRST" == '1' ]]; then
-            for i in ${!LONG_OPTIONS[@]}; do
-                if [[ "${LONG_OPTIONS[$i]}" == "help" ]]; then
-                    _nmcli_array_delete_at LONG_OPTIONS $i
-                    break
-                fi
-            done
-        fi
-
-        case "$W" in
-            terse)
-                _nmcli_array_delete_at words 0
-                ;;
-            pretty)
-                _nmcli_array_delete_at words 0
-                ;;
-            ask)
-                _nmcli_array_delete_at words 0
-                ;;
-            show-secrets)
-                _nmcli_array_delete_at words 0
-                ;;
-            order)
-                if [[ "${#words[@]}" -eq 2 ]]; then
-                   local ord="${words[1]}"
-                   local ord_sta=""
-                   local i
-                   local c=()
-
-                   # FIXME: currently the completion considers colon as separator
-                   # for words. Hence the following doesn't work as $ord will
-                   # not contain any colons at this point.
-                   # See https://bugzilla.gnome.org/show_bug.cgi?id=745157
-
-                   if [[ $ord = *":"* ]]; then
-                       ord_sta="${ord%:*}:"
-                       ord="${ord##*:}"
-                   fi
-                   if [[ $ord = [-+]* ]]; then
-                       ord_sta="$ord_sta${ord:0:1}"
-                   fi
-                   for i in active name type path; do
-                       c=("${c[@]}" "$ord_sta$i")
-                   done
-                   _nmcli_list "${c[*]}"
-                   return 0
-                fi
-                _nmcli_array_delete_at words 0 1
-                ;;
-            active)
-                _nmcli_array_delete_at words 0
-                ;;
-            version)
-                _nmcli_array_delete_at words 0
-                ;;
-            help)
-                _nmcli_array_delete_at words 0
-                if [[ "$HELP_ONLY_AS_FIRST" == 1 ]]; then
-                    HELP_ONLY_AS_FIRST=0
-                    return 0
-                fi
-                HELP_ONLY_AS_FIRST=0
-                ;;
-            temporary)
-                _nmcli_array_delete_at words 0
-                ;;
-            mode)
-                if [[ "${#words[@]}" -eq 2 ]]; then
-                    _nmcli_list "tabular multiline"
-                    return 0
-                fi
-                _nmcli_array_delete_at words 0 1
-                ;;
-            colors)
-                if [[ "${#words[@]}" -eq 2 ]]; then
-                    _nmcli_list "yes no auto"
-                    return 0
-                fi
-                _nmcli_array_delete_at words 0 1
-                ;;
-            fields)
-                if [[ "${#words[@]}" -eq 2 ]]; then
-                    _nmcli_list "all common
-                        NAME UUID TYPE TIMESTAMP TIMESTAMP-REAL AUTOCONNECT READONLY DBUS-PATH ACTIVE DEVICE STATE ACTIVE-PATH
-                        connection 802-3-ethernet 802-1x 802-11-wireless 802-11-wireless-security ipv4 ipv6 serial ppp pppoe gsm cdma bluetooth 802-11-olpc-mesh vpn wimax infiniband bond vlan adsl bridge bridge-port team team-port dcb tun ip-tunnel macvlan vxlan
-                        GENERAL IP4 DHCP4 IP6 DHCP6 VPN
-                        profile active"
-                    return 0
-                fi
-                _nmcli_array_delete_at words 0 1
-                ;;
-            escape)
-                if [[ "${#words[@]}" -eq 2 ]]; then
-                    _nmcli_list "no yes"
-                    return 0
-                fi
-                _nmcli_array_delete_at words 0 1
-                ;;
-            wait)
-                if [[ "${#words[@]}" -eq 2 ]]; then
-                    _nmcli_list ""
-                    return 0
-                fi
-                _nmcli_array_delete_at words 0 1
-                ;;
-            *)
-                # something unexpected. We are finished with parsing the OPTIONS.
-                return 2
-                ;;
-        esac
-    done
-}
-
-# after the OPTIONS, the OBJECT, the COMMAND and possible the COMMAND_CONNECTION, the syntax for nmcli
-# expects several options with parameters. This function can parse them and remove them from the words array.
-_nmcli_compl_ARGS()
-{
-    local aliases=${@}
-    local OPTIONS_ALL N_REMOVE_WORDS REMOVE_OPTIONS OPTIONS_HAS_MANDATORY i
-    OPTIONS_ALL=("${OPTIONS[@]}")
-    OPTIONS_UNKNOWN_OPTION=
-
-    OPTIONS_HAS_MANDATORY=0
-    if [[ "${#OPTIONS_MANDATORY[@]}" -ge 1 ]]; then
-        OPTIONS_HAS_MANDATORY=1
-    fi
-
-    for (( ; ; )); do
-        if [[ "${#words[@]}" -le 1 ]]; then
-            # we have no more words left...
-            if [[ ${#OPTIONS[@]} -eq 0 ]]; then
-                return 1;
-            fi
-            if [[ "$COMMAND_ARGS_WAIT_OPTIONS" -ne 1 ]]; then
-                _nmcli_list "$(echo "${OPTIONS[@]}")"
-                return 0
-            fi
-            COMMAND_ARGS_WAIT_OPTIONS=0
-            return 1
-        fi
-        if ! _nmcli_array_has_value OPTIONS_ALL "${words[0]}"; then
-            # This is an entirely unknown option.
-            OPTIONS_UNKNOWN_OPTION="?${words[0]}"
-            return 1
-        fi
-        if [[ "$OPTIONS_HAS_MANDATORY" -eq 1 && "${#OPTIONS_MANDATORY[@]}" -eq 0 ]]; then
-            # we had some mandatory options, but they are all satisfied... stop here...
-            # This means, that we can continue with more additional options from the NEXT_GROUP.
-            return 1
-        fi
-
-        N_REMOVE_WORDS=2
-        REMOVE_OPTIONS=("${words[0]}")
-
-        # change option name to alias
-        WORD0="${words[0]}"
-        for alias in "${aliases[@]}" ; do
-            if [[ "${WORD0}" == ${alias%%:*} ]]; then
-                WORD0=${alias#*:}
-                break
-            fi
-        done
-
-        case "${WORD0}" in
-            level)
-                if [[ "${#words[@]}" -eq 2 ]]; then
-                    _nmcli_list "OFF ERR WARN INFO DEBUG TRACE KEEP"
-                   return 0
-                fi
-                ;;
-            domains)
-                if [[ "${#words[@]}" -eq 2 ]]; then
-                    local OPTIONS_DOM=(ALL DEFAULT DHCP IP PLATFORM RFKILL ETHER WIFI BT MB DHCP4 DHCP6 PPP WIFI_SCAN IP4 IP6 AUTOIP4 DNS VPN SHARING SUPPLICANT AGENTS SETTINGS SUSPEND CORE DEVICE OLPC WIMAX INFINIBAND FIREWALL ADSL BOND VLAN BRIDGE DBUS_PROPS TEAM CONCHECK DCB DISPATCH AUDIT SYSTEMD VPN_PLUGIN)
-                    if [[ "${words[1]}" != "" ]]; then
-
-                        # split the comma separaeted domain string into its parts LOGD
-                        local oIFS="$IFS"
-                        IFS=","
-                        local LOGD=($(printf '%s' "${words[1]}" | sed 's/\(^\|,\)/,#/g'))
-                        IFS="$oIFS"
-                        unset oIFS
-
-                        local LOGDLAST LOGDLAST_IS_OPTION LOGDI i
-                        # first we iterate over all present domains and remove them from OPTIONS_DOM
-                        for LOGDI in ${LOGD[@]}; do
-                            LOGDI="${LOGDI:1}"
-                            LOGDLAST="$LOGDI"
-                            LOGDLAST_IS_OPTION=0
-                            for i in ${!OPTIONS_DOM[*]}; do
-                                if [[ "${OPTIONS_DOM[$i]}" = "$LOGDI" ]]; then
-                                    LOGDLAST_IS_OPTION=1
-                                    unset OPTIONS_DOM[$i]
-                                fi
-                            done
-                        done
-
-                        local OPTIONS_DOM2=()
-                        if [[ "$LOGDLAST" = "" ]]; then
-                            # we have a word that ends with ','. Just append all remaining options.
-                            for i in ${!OPTIONS_DOM[*]}; do
-                                OPTIONS_DOM2[${#OPTIONS_DOM2[@]}]="${words[1]}${OPTIONS_DOM[$i]}"
-                            done
-                        else
-                            # if the last option is not "" we keep only those option with the same prefix
-                            # as the last domain (LOGDLAST)
-                            for i in ${!OPTIONS_DOM[*]}; do
-                                if [[ "${OPTIONS_DOM[$i]:0:${#LOGDLAST}}" == "$LOGDLAST" ]]; then
-                                    # modify the option with the present prefix
-                                    OPTIONS_DOM2[${#OPTIONS_DOM2[@]}]="${words[1]}${OPTIONS_DOM[$i]:${#LOGDLAST}}"
-                                fi
-                            done
-
-                            if [[ $LOGDLAST_IS_OPTION -eq 1 ]]; then
-                                # if the last logd itself was a valid iption, ${words[1]} is itself a valid match
-                                OPTIONS_DOM2[${#OPTIONS_DOM2[@]}]="${words[1]}"
-
-                                # also, add all remaining options by comma separated to the word.
-                                for i in ${!OPTIONS_DOM[*]}; do
-                                    OPTIONS_DOM2[${#OPTIONS_DOM2[@]}]="${words[1]},${OPTIONS_DOM[$i]}"
-                                done
-                            fi
-                            if [[ ${#OPTIONS_DOM2[@]} -eq 1 ]]; then
-                                for i in ${!OPTIONS_DOM[*]}; do
-                                    if [[ "$LOGDLAST" != "${OPTIONS_DOM[$i]:0:${#LOGDLAST}}" ]]; then
-                                        OPTIONS_DOM2[${#OPTIONS_DOM2[@]}]="${OPTIONS_DOM2[0]},${OPTIONS_DOM[$i]}"
-                                    fi
-                                done
-                            fi
-
-                        fi
-                        OPTIONS_DOM=(${OPTIONS_DOM2[@]})
-                    fi
-
-                    _nmcli_list "$(echo "${OPTIONS_DOM[@]}")"
-                   return 0
-                fi
-                ;;
-            type)
-                if [[ "$OPTIONS_TYPE" != "" ]]; then
-                    return 1
-                fi
-                if [[ "${#words[@]}" -eq 2 ]]; then
-                    if [[ "${words[1]:0:1}" = "8" ]]; then
-                        # usually we don't want to show the 802-x types (because the shorter aliases are more
-                        # user friendly. Only complete them, if the current word already starts with an "8".
-                        _nmcli_list "802-3-ethernet 802-11-wireless 802-11-olpc-mesh"
-                    else
-                        _nmcli_list "ethernet wifi wimax gsm cdma infiniband bluetooth vpn olpc-mesh vlan bond bridge team pppoe adsl tun ip-tunnel macvlan vxlan"
-                    fi
-                    return 0
-                fi
-                OPTIONS_TYPE="${words[1]}"
-
-                if [[ "x$OPTIONS_MANDATORY_IFNAME" != x ]]; then
-                    # the ifname is not a mandatory option for a few connection types...
-                    # Check, if we have such a 'type' and remove the 'ifname' from the list
-                    # of mandatory options.
-                    case "$OPTIONS_TYPE" in
-                        vl|vla|vlan| \
-                        bond| \
-                        team| \
-                        bridge)
-                            for i in ${!OPTIONS_MANDATORY[*]}; do
-                                if [[ "${OPTIONS_MANDATORY[$i]}" = "ifname" ]]; then
-                                    unset OPTIONS_MANDATORY[$i]
-                                fi
-                            done
-                            ;;
-                        *)
-                            ;;
-
-                    esac
-                    OPTIONS_MANDATORY_IFNAME=
-                fi
-                ;;
-            master)
-                if [[ "${#words[@]}" -eq 2 ]]; then
-                    if [[ "${words[1]}" = "" ]]; then
-                        _nmcli_list_nl "$(_nmcli_dev_status DEVICE)"
-                    else
-                        _nmcli_list_nl "$(printf "%s\n%s\n%s" "$(_nmcli_dev_status DEVICE)" "$(_nmcli_con_show UUID)")"
-                   fi
-                   return 0
-                fi
-                ;;
-            dev)
-                if [[ "${#words[@]}" -eq 2 ]]; then
-                    if [[ "${words[1]}" = "" ]]; then
-                        _nmcli_list_nl "$(_nmcli_dev_status DEVICE)"
-                    else
-                        _nmcli_list_nl "$(printf "%s\n%s\n%s" "$(_nmcli_dev_status DEVICE)" "$(_nmcli_wifi_list BSSID)" "$(_nmcli_con_show UUID)")"
-                   fi
-                   return 0
-                fi
-                ;;
-            primary| \
-            ifname)
-                if [[ "${#words[@]}" -eq 2 ]]; then
-                    _nmcli_list_nl "$(_nmcli_dev_status DEVICE)"
-                   return 0
-                fi
-                ;;
-            mode)
-                if [[ "${#words[@]}" -eq 2 ]]; then
-                    case "$OPTIONS_TYPE" in
-                        "wifi")
-                            _nmcli_list "infrastructure ap adhoc"
-                            ;;
-                        "tun")
-                            _nmcli_list "tun tap"
-                            ;;
-                        "ip-tunnel")
-                            _nmcli_list "ipip gre sit isatap vti ip6ip6 ipip6 ip6gre vti6"
-                            ;;
-                        "macvlan")
-                            _nmcli_list "vepa bridge private passthru source"
-                            ;;
-                        "bond"| \
-                        *)
-                        _nmcli_list "balance-rr active-backup balance-xor broadcast 802.3ad balance-tlb balance-alb"
-                    esac
-                    return 0
-                fi
-                ;;
-            transport-mode)
-                if [[ "${#words[@]}" -eq 2 ]]; then
-                    _nmcli_list "datagram connected"
-                    return 0
-                fi
-                ;;
-            vpn-type)
-                if [[ "${#words[@]}" -eq 2 ]]; then
-                    _nmcli_list "vpnc openvpn pptp openconnect openswan libreswan strongswan ssh l2tp iodine fortisslvpn"
-                    return 0
-                fi
-                ;;
-            slave-type)
-                if [[ "${#words[@]}" -eq 2 ]]; then
-                    _nmcli_list "bond team bridge"
-                    return 0
-                fi
-                ;;
-            lacp-rate)
-                if [[ "${#words[@]}" -eq 2 ]]; then
-                    _nmcli_list "slow fast"
-                    return 0
-                fi
-                ;;
-            bt-type)
-                if [[ "${#words[@]}" -eq 2 ]]; then
-                    _nmcli_list "panu dun-gsm dun-cdma"
-                    return 0
-                fi
-                ;;
-            wep-key-type)
-                if [[ "${#words[@]}" -eq 2 ]]; then
-                    _nmcli_list "key phrase"
-                    return 0
-                fi
-                ;;
-            managed| \
-            autoconnect| \
-            stp| \
-            hairpin| \
-            save| \
-            hidden| \
-            private| \
-            pi| \
-            vnet-hdr| \
-            multi-queue|\
-            tap)
-                if [[ "${#words[@]}" -eq 2 ]]; then
-                    _nmcli_list "yes no"
-                    return 0
-                fi
-                ;;
-            config)
-                if [[ "${#words[@]}" -eq 2 ]]; then
-                    compopt -o default
-                    COMPREPLY=()
-                    return 0
-                fi
-                ;;
-            ip4| \
-            ip6| \
-            gw4| \
-            gw6| \
-            priority| \
-            forward-delay| \
-            hello-time| \
-            max-age| \
-            ageing-time| \
-            nsp| \
-            path-cost| \
-            name| \
-            mtu| \
-            cloned-mac| \
-            addr| \
-            parent| \
-            miimon| \
-            arp-interval| \
-            arp-ip-target| \
-            downdelay| \
-            updelay| \
-            p-key| \
-            mac| \
-            id| \
-            flags| \
-            ingress| \
-            dhcp-anycast| \
-            channel| \
-            egress| \
-            apn| \
-            con-name| \
-            user| \
-            username| \
-            service| \
-            password)
-                if [[ "${#words[@]}" -eq 2 ]]; then
-                    return 0
-                fi
-                ;;
-            passwd-file| \
-            file)
-                if [[ "${#words[@]}" -eq 2 ]]; then
-                    compopt -o default
-                    COMPREPLY=()
-                    return 0
-                fi
-                ;;
-            ssid)
-                if [[ "${#words[@]}" -eq 2 ]]; then
-                    _nmcli_list_nl "$(_nmcli_wifi_list SSID)"
-                    return 0
-                fi
-                ;;
-            ap| \
-            bssid)
-                if [[ "${#words[@]}" -eq 2 ]]; then
-                    _nmcli_list_nl "$(_nmcli_wifi_list BSSID)"
-                    return 0
-                fi
-                ;;
-            encapsulation)
-                if [[ "${#words[@]}" -eq 2 ]]; then
-                    _nmcli_list "vcmux llc"
-                    return 0
-                fi
-                ;;
-            protocol)
-                if [[ "${#words[@]}" -eq 2 ]]; then
-                    _nmcli_list "pppoa pppoe ipoatm"
-                    return 0
-                fi
-                ;;
-            band)
-                if [[ "${#words[@]}" -eq 2 ]]; then
-                    _nmcli_list "a bg"
-                    return 0
-                fi
-                ;;
-            *)
-                return 1
-                ;;
-        esac
-
-
-        if [[ "${#OPTIONS_NEXT_GROUP[@]}" -gt 0 ]]; then
-            if _nmcli_array_has_value OPTIONS_NEXT_GROUP "${words[0]}"; then
-                # the current value is from the next group...
-                # We back off, because the current group is complete.
-                return 1
-            fi
-        fi
-
-        _nmcli_array_delete_at words 0 $((N_REMOVE_WORDS-1))
-        # remove the options already seen.
-        for i in ${!OPTIONS[*]}; do
-            if [[ "${OPTIONS[$i]}" = "${REMOVE_OPTIONS[0]}" || "${OPTIONS[$i]}" = "${REMOVE_OPTIONS[1]}" ]]; then
-                if ! _nmcli_array_has_value OPTIONS_REPEATABLE "${OPTIONS[$i]}" ; then
-                    unset OPTIONS[$i]
-                fi
-            fi
-        done
-        for i in ${!OPTIONS_MANDATORY[*]}; do
-            if [[ "${OPTIONS_MANDATORY[$i]}" = "${REMOVE_OPTIONS[0]}" || "${OPTIONS_MANDATORY[$i]}" = "${REMOVE_OPTIONS[1]}" ]]; then
-                unset OPTIONS_MANDATORY[$i]
-            fi
-        done
-    done
-}
-
-# some commands expect a connection as parameter. This connection can either be given
-# as id|uuid|path|apath. Parse that connection parameter.
-# Actually, it can also ask for a device name, like `nmcli device set [ifname] <ifname>`
-_nmcli_compl_ARGS_CONNECTION()
-{
-    if ! _nmcli_array_has_value OPTIONS "${words[0]}"; then
-        COMMAND_CONNECTION_TYPE=
-        COMMAND_CONNECTION_ID="${words[0]}"
-        _nmcli_array_delete_at words 0
-        return 1
-    fi
-    COMMAND_CONNECTION_TYPE="${words[0]}"
-    COMMAND_CONNECTION_ID="${words[1]}"
-    local CON_TYPE=
-    if [[ "x$COMMAND_CONNECTION_ACTIVE" != x ]]; then
-        CON_TYPE=--active
-    fi
-    case "${words[0]}" in
-        id)
-            if [[ ${#words[@]} -le 2 ]]; then
-                _nmcli_list_nl "$(_nmcli_con_show NAME $CON_TYPE)"
-                return 0
-            fi
-            _nmcli_array_delete_at words 0 1
-            ;;
-        uuid)
-            if [[ ${#words[@]} -le 2 ]]; then
-                _nmcli_list_nl "$(_nmcli_con_show UUID $CON_TYPE)"
-                return 0
-            fi
-            _nmcli_array_delete_at words 0 1
-            ;;
-        path)
-            if [[ ${#words[@]} -le 2 ]]; then
-                _nmcli_list_nl "$(_nmcli_con_show DBUS-PATH $CON_TYPE)"
-                return 0
-            fi
-            _nmcli_array_delete_at words 0 1
-            ;;
-        apath)
-            if [[ ${#words[@]} -le 2 ]]; then
-                _nmcli_list_nl "$(_nmcli_con_show ACTIVE-PATH --active)"
-                return 0
-            fi
-            _nmcli_array_delete_at words 0 1
-            ;;
-        ifname)
-            if [[ ${#words[@]} -le 2 ]]; then
-                _nmcli_list_nl "$(_nmcli_dev_status DEVICE)"
-                return 0
-            fi
-            _nmcli_array_delete_at words 0 1
-            ;;
-        *)
-            COMMAND_CONNECTION_TYPE=
-            COMMAND_CONNECTION_ID="${words[0]}"
-            _nmcli_array_delete_at words 0
-            ;;
-    esac
-    return 1
-}
-
-_nmcli_compl_COMMAND() {
-    local command="$1"
-    shift
-    local V=("$@")
-    local H=
-    if [[ "${command[0]:0:1}" != '-' ]]; then
-        H=help
-    elif [[ "${command[0]:1:1}" == '-' ||  "${command[0]}" == "-" ]]; then
-        H=--help
-    else
-        H=-help
-    fi
-    if [[ "x$COMPL_COMMAND_NO_HELP" == x ]]; then
-        V=("${V[@]}" "$H")
-    fi
-    _nmcli_list "${V[*]}"
-}
-
-_nmcli_compl_COMMAND_nl() {
-    local command="$1"
-    local a="$2"
-    shift
-    shift
-    local V=("$@")
-    local H=
-    if [[ "${command[0]:0:1}" != '-' ]]; then
-        V=("${V[@]/#/--}")
-        H=help
-    elif [[ "${command[0]:1:1}" == '-' ||  "${command[0]}" == "-" ]]; then
-        V=("${V[@]/#/--}")
-        H=--help
-    else
-        V=("${V[@]/#/-}")
-        H=-help
-    fi
-    if [[ "x$COMPL_COMMAND_NO_HELP" == x ]]; then
-        V=("${V[@]}" "$H")
-    fi
-    local IFS=$'\n'
-    V="${V[*]}"
-    _nmcli_list_nl "$(printf "%s%s\n%s" "" "$V" "$a")"
-}
-
-_nmcli_compl_PROPERTIES()
-{
-    while [[ ${#words[@]} -gt 0 ]]; do
-        if [[ ${#words[@]} -eq 1 ]]; then
-            _nmcli_list_nl "$(nmcli --complete-args connection modify "$@" "${words[@]}" 2>/dev/null)"
-            return 0
-        fi
-        _nmcli_array_delete_at words 0 1
-    done
-    return 0
-}
-
-_nmcli()
-{
-    local cur prev words cword i
-    _init_completion || return
-
-    # we don't care about any arguments after the current cursor position
-    # because we only parse from left to right. So, if there are some arguments
-    # right of the cursor, just ignore them. Also don't care about ${words[0]}.
-    _nmcli_array_delete_at words $((cword+1)) ${#words[@]}
-    _nmcli_array_delete_at words 0
-
-    # _init_completion returns the words with all the quotes and escaping
-    # characters. We don't care about them, drop them at first.
-    for i in ${!words[@]}; do
-        words[i]="$(printf '%s' "${words[i]}" | xargs printf '%s\n' 2>/dev/null || true)"
-    done
-
-    # In case the cursor is not at the end of the line,
-    # $cur consists of spaces that we want do remove.
-    # For example: `nmcli connection modify id  <TAB>  lo`
-    if [[ "$cur" =~ ^[[:space:]]+ ]]; then
-        cur=''
-    fi
-
-    local OPTIONS OPTIONS_UNKNOWN_OPTION OPTIONS_TYPE OPTIONS_TYPED OPTIONS_IP OPTIONS_NEXT_GROUP \
-          OPTIONS_SEP OPTIONS_REPEATABLE OPTIONS_MANDATORY OPTIONS_MANDATORY_IFNAME \
-          COMMAND_ARGS_WAIT_OPTIONS COMMAND_CONNECTION_TYPE COMMAND_CONNECTION_ID \
-          COMMAND_CONNECTION_ACTIVE="" HELP_ONLY_AS_FIRST="" \
-          LONG_OPTIONS=(terse pretty mode fields colors escape ask show-secrets wait version help)
-
-    _nmcli_compl_OPTIONS
-    i=$?
-
-    case $i in
-        0)
-            # We have just completed an option or got an --help: terminate.
-            return 0
-            ;;
-        1)
-            # we show for completion either the (remaining) OPTIONS
-            # (if the current word starts with a dash) or the OBJECT list
-            # otherwise.
-            if [[ "${words[0]:0:1}" != '-' ]]; then
-                OPTIONS=(help general networking radio connection device agent monitor)
-            elif [[ "${words[0]:1:1}" == '-' ||  "${words[0]}" == "-" ]]; then
-                OPTIONS=("${LONG_OPTIONS[@]/#/--}")
-            else
-                OPTIONS=("${LONG_OPTIONS[@]/#/-}")
-            fi
-            _nmcli_list "${OPTIONS[*]}"
-            return 0
-            ;;
-    esac
-
-    local command="${words[1]}"
-    case "${words[0]}" in
-        h|he|hel|help)
-            ;;
-        g|ge|gen|gene|gener|genera|general)
-            if [[ ${#words[@]} -eq 2 ]]; then
-                _nmcli_compl_COMMAND "$command" status permissions logging hostname
-            elif [[ ${#words[@]} -gt 2 ]]; then
-                case "$command" in
-                    ho|hos|host|hostn|hostna|hostnam|hostname)
-                        if [[ ${#words[@]} -eq 3 ]]; then
-                            _nmcli_compl_COMMAND_nl "${words[2]}" \
-                                        "$(printf '%s\n%s\n%s\n' \
-                                            "$(nmcli general hostname 2>/dev/null)" \
-                                            "$(cat /etc/hostname 2>/dev/null)" \
-                                            "$(hostnamectl status 2>/dev/null | sed -n '1s/^.\+hostname: \(.\+\)$/\1/p')" \
-                                            "$HOSTNAME")"
-                        fi
-                        ;;
-                    l|lo|log|logg|loggi|loggin|logging)
-                        if [[ ${#words[@]} -eq 3 ]]; then
-                            _nmcli_compl_COMMAND "${words[2]}" level domains
-                        else
-                            _nmcli_array_delete_at words 0 1
-                            OPTIONS=(level domains)
-                            _nmcli_compl_ARGS
-                        fi
-                        ;;
-                    s|st|sta|stat|statu|status| \
-                    p|pe|per|perm|permi|permis|permiss|permissi|permissio|permission|permissions)
-                        if [[ ${#words[@]} -eq 3 ]]; then
-                            _nmcli_compl_COMMAND "${words[2]}"
-                        fi
-                        ;;
-                esac
-            fi
-            ;;
-        n|ne|net|netw|netwo|networ|network|networki|networkin|networking)
-            if [[ ${#words[@]} -eq 2 ]]; then
-                _nmcli_compl_COMMAND "$command" on off connectivity
-            elif [[ ${#words[@]} -eq 3 ]]; then
-                case "$command" in
-                    c|co|con|conn|conne|connec|connect|connecti|connectiv|connectivi|connectivit|connectivity)
-                        _nmcli_compl_COMMAND "${words[2]}" "check"
-                        ;;
-                esac
-            fi
-            ;;
-        r|ra|rad|radi|radio)
-            if [[ ${#words[@]} -eq 2 ]]; then
-                _nmcli_compl_COMMAND "$command" all wifi wwan
-            elif [[ ${#words[@]} -eq 3 ]]; then
-                case "$command" in
-                    a|al|all | w|wi|wif|wifi | ww|wwa|wwan)
-                        _nmcli_compl_COMMAND "${words[2]}" "on off"
-                        ;;
-                esac
-            fi
-            ;;
-        c|co|con|conn|conne|connec|connect|connecti|connectio|connection)
-            if [[ ${#words[@]} -eq 2 ]]; then
-                _nmcli_compl_COMMAND "$command" show up down add modify clone edit delete monitor reload load import export
-            elif [[ ${#words[@]} -gt 2 ]]; then
-                case "$command" in
-                    s|sh|sho|show)
-                        if [[ ${#words[@]} -eq 3 ]]; then
-                            _nmcli_compl_COMMAND_nl "${words[2]}" "$(printf "id\nuuid\npath\napath\n%s" "$(_nmcli_con_show NAME)")" active order
-                        elif [[ ${#words[@]} -gt 3 ]]; then
-                            _nmcli_array_delete_at words 0 1
-
-                            LONG_OPTIONS=(help active order)
-                            HELP_ONLY_AS_FIRST=1
-                            _nmcli_compl_OPTIONS
-                            i=$?
-
-                            if ! _nmcli_array_has_value LONG_OPTIONS active; then
-                                COMMAND_CONNECTION_ACTIVE=1
-                            fi
-
-                            case $i in
-                                0)
-                                    return 0
-                                    ;;
-                                1)
-                                    if [[ "$HELP_ONLY_AS_FIRST" == 1 ]]; then
-                                        if [[ "x$COMMAND_CONNECTION_ACTIVE" = x ]]; then
-                                            _nmcli_compl_COMMAND_nl "${words[2]}" "$(printf "id\nuuid\npath\napath\n%s" "$(_nmcli_con_show NAME)")" "${LONG_OPTIONS[@]}"
-
-                                        else
-                                            _nmcli_compl_COMMAND_nl "${words[2]}" "$(printf "id\nuuid\npath\napath\n%s" "$(_nmcli_con_show NAME --active)")" "${LONG_OPTIONS[@]}"
-                                        fi
-                                    fi
-                                    return 0
-                                    ;;
-                            esac
-
-                            OPTIONS=(id uuid path apath)
-                            while [[ ${#words[@]} -gt 0 ]]; do
-                                _nmcli_compl_ARGS_CONNECTION && return 0
-                            done
-                            if [[ "x$COMMAND_CONNECTION_ACTIVE" = x ]]; then
-                                _nmcli_list_nl "$(printf "id\nuuid\npath\napath\n%s" "$(_nmcli_con_show NAME)")"
-                            else
-                                _nmcli_list_nl "$(printf "id\nuuid\npath\napath\n%s" "$(_nmcli_con_show NAME --active)")"
-                            fi
-                        fi
-                        ;;
-                    u|up)
-                        if [[ ${#words[@]} -eq 3 ]]; then
-                            _nmcli_compl_COMMAND_nl "${words[2]}" "$(printf "ifname\nid\nuuid\npath\n%s" "$(_nmcli_con_show NAME)")"
-                        elif [[ ${#words[@]} -gt 3 ]]; then
-                            _nmcli_array_delete_at words 0 1
-
-                            LONG_OPTIONS=(help)
-                            HELP_ONLY_AS_FIRST=1
-                            _nmcli_compl_OPTIONS
-
-                           case $? in
-                                0)
-                                    return 0
-                                    ;;
-                                1)
-                                    if [[ "$HELP_ONLY_AS_FIRST" == 1 ]]; then
-                                        _nmcli_compl_COMMAND_nl "${words[2]}" "$(printf "ifname\nid\nuuid\npath\n%s" "$(_nmcli_con_show NAME)")" "${LONG_OPTIONS[@]}"
-                                    fi
-                                    return 0
-                                    ;;
-                            esac
-
-                            local COMMAND_CONNECTION_TYPE=''
-                            OPTIONS=(ifname id uuid path)
-                            _nmcli_compl_ARGS_CONNECTION && return 0
-
-                            if [[ "$COMMAND_CONNECTION_TYPE" = "ifname" ]]; then
-                                OPTIONS=(ap nsp passwd-file)
-                            else
-                                OPTIONS=(ifname ap nsp passwd-file)
-                            fi
-                            _nmcli_compl_ARGS
-                        fi
-                        ;;
-                    d|do|dow|down)
-                        if [[ ${#words[@]} -eq 3 ]]; then
-                            _nmcli_compl_COMMAND_nl "${words[2]}" "$(printf "id\nuuid\npath\napath\n%s" "$(_nmcli_con_show NAME --active)")"
-                        elif [[ ${#words[@]} -gt 3 ]]; then
-                            _nmcli_array_delete_at words 0 1
-
-                            LONG_OPTIONS=(help)
-                            HELP_ONLY_AS_FIRST=1
-                            _nmcli_compl_OPTIONS
-                           case $? in
-                                0)
-                                    return 0
-                                    ;;
-                                1)
-                                    if [[ "$HELP_ONLY_AS_FIRST" == 1 ]]; then
-                                        _nmcli_compl_COMMAND_nl "${words[2]}" "$(printf "id\nuuid\npath\napath\n%s" "$(_nmcli_con_show NAME --active)")" "${LONG_OPTIONS[@]}"
-                                    fi
-                                    return 0
-                                    ;;
-                            esac
-
-                            OPTIONS=(id uuid path apath)
-                            COMMAND_CONNECTION_ACTIVE=1
-                            _nmcli_compl_ARGS_CONNECTION && return 0
-                        fi
-                        ;;
-                    a|ad|add)
-                        if [[ ${#words[@]} -eq 3 ]]; then
-                            _nmcli_compl_COMMAND_nl "${words[2]}" "$(nmcli --complete-args connection add "" 2>/dev/null)"
-                        else
-                            _nmcli_array_delete_at words 0 1
-                            _nmcli_list_nl "$(nmcli --complete-args connection add "${words[@]}" 2>/dev/null)"
-                        fi
-                        ;;
-                    e|ed|edi|edit)
-                        if [[ ${#words[@]} -eq 3 ]]; then
-                            _nmcli_compl_COMMAND_nl "${words[2]}" "$(printf "id\nuuid\npath\ntype\ncon-name\n%s" "$(_nmcli_con_show NAME)")"
-                        elif [[ ${#words[@]} -gt 3 ]]; then
-                            _nmcli_array_delete_at words 0 1
-
-                            LONG_OPTIONS=(help)
-                            HELP_ONLY_AS_FIRST=1
-                            _nmcli_compl_OPTIONS
-
-                           case $? in
-                                0)
-                                    return 0
-                                    ;;
-                                1)
-                                    if [[ "$HELP_ONLY_AS_FIRST" == 1 ]]; then
-                                        _nmcli_compl_COMMAND_nl "${words[2]}" "$(printf "id\nuuid\npath\ntype\ncon-name\n%s" "$(_nmcli_con_show NAME)")" "${LONG_OPTIONS[@]}"
-                                    fi
-                                    return 0
-                                    ;;
-                            esac
-
-                            if [[ "${words[0]}" = 'type' || "${words[0]}" = 'con-name' ]]; then
-                                OPTIONS=(type con-name)
-                                _nmcli_compl_ARGS
-                            else
-                                OPTIONS=(id uuid path apath)
-                                _nmcli_compl_ARGS_CONNECTION
-                            fi
-                        fi
-                        ;;
-                    m|mo|mod|modi|modif|modify)
-                        if [[ ${#words[@]} -eq 3 ]]; then
-                            _nmcli_compl_COMMAND_nl "${words[2]}" "$(printf "id\nuuid\npath\n%s" "$(_nmcli_con_show NAME)")" temporary
-                        elif [[ ${#words[@]} -gt 3 ]]; then
-                            _nmcli_array_delete_at words 0 1
-
-                            LONG_OPTIONS=(help temporary)
-                            HELP_ONLY_AS_FIRST=1
-                            _nmcli_compl_OPTIONS
-                            case $? in
-                                0)
-                                    return 0
-                                    ;;
-                                1)
-                                    if [[ "$HELP_ONLY_AS_FIRST" == 1 ]]; then
-                                        _nmcli_compl_COMMAND_nl "${words[2]}" "$(printf "id\nuuid\npath\n%s" "$(_nmcli_con_show NAME)")" "${LONG_OPTIONS[@]}"
-                                    fi
-                                    return 0
-                                    ;;
-                            esac
-
-                            OPTIONS=(id uuid path)
-                            _nmcli_compl_ARGS_CONNECTION && return 0
-
-                            _nmcli_compl_PROPERTIES ${COMMAND_CONNECTION_TYPE} "$COMMAND_CONNECTION_ID"
-
-                            return 0
-                        fi
-                        ;;
-                    c|cl|clo|clon|clone)
-                        if [[ ${#words[@]} -eq 3 ]]; then
-                            _nmcli_compl_COMMAND_nl "${words[2]}" "$(printf "id\nuuid\npath\n%s" "$(_nmcli_con_show NAME)")" temporary
-                        elif [[ ${#words[@]} -gt 3 ]]; then
-                            _nmcli_array_delete_at words 0 1
-
-                            LONG_OPTIONS=(help temporary)
-                            HELP_ONLY_AS_FIRST=1
-                            _nmcli_compl_OPTIONS
-                            case $? in
-                                0)
-                                    return 0
-                                    ;;
-                                1)
-                                    if [[ "$HELP_ONLY_AS_FIRST" == 1 ]]; then
-                                        _nmcli_compl_COMMAND_nl "${words[2]}" "$(printf "id\nuuid\npath\n%s" "$(_nmcli_con_show NAME)")" "${LONG_OPTIONS[@]}"
-                                    fi
-                                    return 0
-                                    ;;
-                            esac
-
-                            OPTIONS=(id uuid path)
-                            _nmcli_compl_ARGS_CONNECTION && return 0
-
-                            return 0
-                        fi
-                        ;;
-
-                    de|del|dele|delet|delete| \
-                    mon|moni|monit|monito|monitor)
-                        if [[ ${#words[@]} -eq 3 ]]; then
-                            _nmcli_compl_COMMAND_nl "${words[2]}" "$(printf "id\nuuid\npath\n%s" "$(_nmcli_con_show NAME)")"
-                        elif [[ ${#words[@]} -gt 3 ]]; then
-                            _nmcli_array_delete_at words 0 1
-
-                            LONG_OPTIONS=(help)
-                            _nmcli_compl_OPTIONS
-                            case $? in
-                                0)
-                                    return 0
-                                    ;;
-                                1)
-                                    if ! _nmcli_array_has_value LONG_OPTIONS "help"; then
-                                        return 0
-                                    fi
-                                    ;;
-                            esac
-
-                            OPTIONS=(id uuid path apath)
-                            while [[ ${#words[@]} -gt 0 ]]; do
-                                _nmcli_compl_ARGS_CONNECTION && return 0
-                            done
-                            _nmcli_list_nl "$(printf "id\nuuid\npath\n%s" "$(_nmcli_con_show NAME)")"
-                        fi
-                        ;;
-                    l|lo|loa|load)
-                        if [[ ${#words[@]} -gt 2 ]]; then
-                            # we should also complete for help/--help, but who to mix that
-                            # with file name completion?
-                            compopt -o default
-                            COMPREPLY=()
-                        fi
-                        ;;
-                    i|im|imp|impo|impor|import)
-                        if [[ ${#words[@]} -eq 3 ]]; then
-                            _nmcli_compl_COMMAND "${words[2]}" type file --temporary
-                        elif [[ ${#words[@]} -gt 3 ]]; then
-                            _nmcli_array_delete_at words 0 1
-
-                            LONG_OPTIONS=(help temporary)
-                            HELP_ONLY_AS_FIRST=1
-                            _nmcli_compl_OPTIONS
-                            case $? in
-                                0)
-                                    return 0
-                                    ;;
-                                1)
-                                    if [[ "$HELP_ONLY_AS_FIRST" == 1 ]]; then
-                                        _nmcli_compl_COMMAND "${words[2]}" type file
-                                    fi
-                                    return 0
-                                    ;;
-                            esac
-
-                            OPTIONS=(type file)
-                            OPTIONS_MANDATORY=(type file)
-                            _nmcli_compl_ARGS type:vpn-type
-                            return 0
-                        fi
-                        ;;
-                    e|ex|exp|expo|expor|export)
-                        if [[ ${#words[@]} -eq 3 ]]; then
-                            _nmcli_compl_COMMAND_nl "${words[2]}" "$(printf "id\nuuid\npath\n%s" "$(_nmcli_con_show NAME)")"
-                        elif [[ ${#words[@]} -gt 3 ]]; then
-                            _nmcli_array_delete_at words 0 1
-
-                            LONG_OPTIONS=(help)
-                            HELP_ONLY_AS_FIRST=1
-                            _nmcli_compl_OPTIONS
-                            case $? in
-                                0)
-                                    return 0
-                                    ;;
-                                1)
-                                    if [[ "$HELP_ONLY_AS_FIRST" == 1 ]]; then
-                                        _nmcli_compl_COMMAND_nl "${words[2]}" "$(printf "id\nuuid\npath\n%s" "$(_nmcli_con_show NAME)")" "${LONG_OPTIONS[@]}"
-                                    fi
-                                    return 0
-                                    ;;
-                            esac
-
-                            OPTIONS=(id uuid path)
-                            _nmcli_compl_ARGS_CONNECTION && return 0
-                            return 0
-                        fi
-                        ;;
-
-                esac
-            fi
-            ;;
-        d|de|dev|devi|devic|device)
-            if [[ ${#words[@]} -eq 2 ]]; then
-                _nmcli_compl_COMMAND "$command" status show connect reapply modify disconnect delete monitor wifi set lldp
-            elif [[ ${#words[@]} -gt 2 ]]; then
-                case "$command" in
-                    s|st|sta|stat|statu|status)
-                        if [[ ${#words[@]} -eq 3 ]]; then
-                            _nmcli_compl_COMMAND "${words[2]}"
-                        fi
-                        ;;
-                    sh|sho|show| \
-                    r|re|rea|reap|reapp|reappl|reapply| \
-                    c|co|con|conn|conne|connec|connect)
-                        if [[ ${#words[@]} -eq 3 ]]; then
-                            _nmcli_compl_COMMAND_nl "${words[2]}" "$(_nmcli_dev_status DEVICE)"
-                        fi
-                        ;;
-                    mod|modi|modif|modify)
-                        if [[ ${#words[@]} -eq 3 ]]; then
-                            _nmcli_compl_COMMAND_nl "${words[2]}" "$(nmcli --complete-args device modify "" 2>/dev/null)"
-                        else
-                            _nmcli_array_delete_at words 0 1
-                            _nmcli_list_nl "$(nmcli --complete-args device modify "${words[@]}" 2>/dev/null)"
-                        fi
-                        ;;
-                    d|di|dis|disc|disco|discon|disconn|disconne|disconnec|disconnect| \
-                    de|del|dele|delet|delete| \
-                    m|mo|mon|moni|monit|monito|monitor)
-                        if [[ ${#words[@]} -ge 3 ]]; then
-                            _nmcli_compl_COMMAND_nl "${words[2]}" "$(_nmcli_dev_status DEVICE)"
-                        fi
-                        ;;
-                    se|set)
-                        if [[ ${#words[@]} -eq 3 ]]; then
-                            _nmcli_compl_COMMAND_nl "${words[2]}" "$(printf "ifname\n%s" "$(_nmcli_dev_status DEVICE)")"
-                        else
-                            _nmcli_array_delete_at words 0 1
-                            OPTIONS=(ifname)
-                            _nmcli_compl_ARGS_CONNECTION && return 0
-                            OPTIONS=(autoconnect managed)
-                            _nmcli_compl_ARGS
-                        fi
-                        ;;
-                    w|wi|wif|wifi)
-                        if [[ ${#words[@]} -eq 3 ]]; then
-                            _nmcli_compl_COMMAND "${words[2]}" list connect hotspot rescan
-                        else
-                            case "${words[2]}" in
-                                l|li|lis|list)
-                                    _nmcli_array_delete_at words 0 2
-                                    OPTIONS=(ifname bssid)
-                                    _nmcli_compl_ARGS
-                                    ;;
-                                c|co|con|conn|conne|connec|connect)
-                                    if [[ ${#words[@]} -eq 4 ]]; then
-                                        if [[ "${words[3]}" = "" ]]; then
-                                            _nmcli_list_nl "$(_nmcli_wifi_list SSID)"
-                                        else
-                                            _nmcli_list_nl "$(printf "%s\n%s" "$(_nmcli_wifi_list SSID)" "$(_nmcli_wifi_list BSSID)")"
-                                        fi
-                                    else
-                                        _nmcli_array_delete_at words 0 3
-                                        local OPTIONS=(password wep-key-type ifname bssid name private hidden)
-                                        _nmcli_compl_ARGS
-                                    fi
-                                    ;;
-                                h|ho|hot|hots|hotsp|hotspo|hotspot)
-                                    _nmcli_array_delete_at words 0 2
-                                    OPTIONS=(ifname con-name ssid band channel password)
-                                    _nmcli_compl_ARGS
-                                    ;;
-                                r|re|res|resc|resca|rescan)
-                                    _nmcli_array_delete_at words 0 2
-                                    OPTIONS_REPEATABLE=(ssid)
-                                    OPTIONS=(ifname ssid)
-                                    _nmcli_compl_ARGS
-                                    ;;
-                            esac
-                        fi
-                        ;;
-                    l|ll|lld|lldp)
-                        if [[ ${#words[@]} -eq 3 ]]; then
-                            _nmcli_compl_COMMAND "${words[2]}" list
-                        else
-                            case "${words[2]}" in
-                                l|li|lis|list)
-                                    _nmcli_array_delete_at words 0 2
-                                    OPTIONS=(ifname)
-                                    _nmcli_compl_ARGS
-                                    ;;
-                            esac
-                        fi
-                        ;;
-                esac
-            fi
-            ;;
-        a|ag|age|agen|agent)
-            if [[ ${#words[@]} -eq 2 ]]; then
-                _nmcli_compl_COMMAND "$command" secret polkit all
-            fi
-            ;;
-        m|mo|mon|moni|monit|monito|monitor)
-            ;;
-    esac
 
-    return 0
 } &&
 complete -F _nmcli nmcli
 
diff --git a/clients/cli/nmcli.c b/clients/cli/nmcli.c
index 5c47e440..b8019403 100644
--- a/clients/cli/nmcli.c
+++ b/clients/cli/nmcli.c
@@ -63,6 +63,8 @@ typedef struct {
 GMainLoop *loop = NULL;
 struct termios termios_orig;
 
+NM_CACHED_QUARK_FCN ("nmcli-error-quark", nmcli_error_quark)
+
 static void
 complete_field (GHashTable *h, const char *setting, NmcOutputField field[])
 {
@@ -89,7 +91,7 @@ complete_one (gpointer key, gpointer value, gpointer user_data)
 	else
 		last = prefix;
 
-	if ((!*last && !strchr (name, '.')) || matches (last, name) == 0) {
+	if ((!*last && !strchr (name, '.')) || matches (last, name)) {
 		g_print ("%.*s%s%s\n", (int)(last-prefix), prefix, name,
 		                       strcmp (last, name) == 0 ? "," : "");
 	}
@@ -129,12 +131,12 @@ complete_fields (const char *prefix)
 	complete_field (h, NULL, nmc_fields_dev_lldp_list);
 
 	complete_field (h, "connection", nmc_fields_setting_connection);
-	complete_field (h, "wired", nmc_fields_setting_wired);
-	complete_field (h, "8021X", nmc_fields_setting_8021X);
-	complete_field (h, "wireless", nmc_fields_setting_wireless);
-	complete_field (h, "wireless_security", nmc_fields_setting_wireless_security);
-	complete_field (h, "ip4-config", nmc_fields_setting_ip4_config);
-	complete_field (h, "ip6-config", nmc_fields_setting_ip6_config);
+	complete_field (h, "802-3-ethernet", nmc_fields_setting_wired);
+	complete_field (h, "802-1x", nmc_fields_setting_8021X);
+	complete_field (h, "802-11-wireless", nmc_fields_setting_wireless);
+	complete_field (h, "802-11-wireless-security", nmc_fields_setting_wireless_security);
+	complete_field (h, "ipv4", nmc_fields_setting_ip4_config);
+	complete_field (h, "ipv6", nmc_fields_setting_ip6_config);
 	complete_field (h, "serial", nmc_fields_setting_serial);
 	complete_field (h, "ppp", nmc_fields_setting_ppp);
 	complete_field (h, "pppoe", nmc_fields_setting_pppoe);
@@ -142,7 +144,7 @@ complete_fields (const char *prefix)
 	complete_field (h, "gsm", nmc_fields_setting_gsm);
 	complete_field (h, "cdma", nmc_fields_setting_cdma);
 	complete_field (h, "bluetooth", nmc_fields_setting_bluetooth);
-	complete_field (h, "olpc-mesh", nmc_fields_setting_olpc_mesh);
+	complete_field (h, "802-11-olpc-mesh", nmc_fields_setting_olpc_mesh);
 	complete_field (h, "vpn", nmc_fields_setting_vpn);
 	complete_field (h, "wimax", nmc_fields_setting_wimax);
 	complete_field (h, "infiniband", nmc_fields_setting_infiniband);
@@ -151,7 +153,7 @@ complete_fields (const char *prefix)
 	complete_field (h, "bridge", nmc_fields_setting_bridge);
 	complete_field (h, "bridge-port", nmc_fields_setting_bridge_port);
 	complete_field (h, "team", nmc_fields_setting_team);
-	complete_field (h, "team0port", nmc_fields_setting_team_port);
+	complete_field (h, "team-port", nmc_fields_setting_team_port);
 	complete_field (h, "dcb", nmc_fields_setting_dcb);
 	complete_field (h, "tun", nmc_fields_setting_tun);
 	complete_field (h, "ip-tunnel", nmc_fields_setting_ip_tunnel);
@@ -163,35 +165,24 @@ complete_fields (const char *prefix)
 }
 
 
-/* Get an error quark for use with GError */
-GQuark
-nmcli_error_quark (void)
-{
-	static GQuark error_quark = 0;
-
-	if (G_UNLIKELY (error_quark == 0))
-		error_quark = g_quark_from_static_string ("nmcli-error-quark");
-
-	return error_quark;
-}
-
 static void
 usage (void)
 {
 	g_printerr (_("Usage: nmcli [OPTIONS] OBJECT { COMMAND | help }\n"
 	              "\n"
 	              "OPTIONS\n"
-	              "  -t[erse]                                   terse output\n"
-	              "  -p[retty]                                  pretty output\n"
-	              "  -m[ode] tabular|multiline                  output mode\n"
-	              "  -c[olors] auto|yes|no                      whether to use colors in output\n"
-	              "  -f[ields] <field1,field2,...>|all|common   specify fields to output\n"
-	              "  -e[scape] yes|no                           escape columns separators in values\n"
-	              "  -a[sk]                                     ask for missing parameters\n"
-	              "  -s[how-secrets]                            allow displaying passwords\n"
-	              "  -w[ait] <seconds>                          set timeout waiting for finishing operations\n"
-	              "  -v[ersion]                                 show program version\n"
-	              "  -h[elp]                                    print this help\n"
+	              "  -t[erse]                                       terse output\n"
+	              "  -p[retty]                                      pretty output\n"
+	              "  -m[ode] tabular|multiline                      output mode\n"
+	              "  -c[olors] auto|yes|no                          whether to use colors in output\n"
+	              "  -f[ields] <field1,field2,...>|all|common       specify fields to output\n"
+	              "  -g[et-values] <field1,field2,...>|all|common   shortcut for -m tabular -t -f\n"
+	              "  -e[scape] yes|no                               escape columns separators in values\n"
+	              "  -a[sk]                                         ask for missing parameters\n"
+	              "  -s[how-secrets]                                allow displaying passwords\n"
+	              "  -w[ait] <seconds>                              set timeout waiting for finishing operations\n"
+	              "  -v[ersion]                                     show program version\n"
+	              "  -h[elp]                                        print this help\n"
 	              "\n"
 	              "OBJECT\n"
 	              "  g[eneral]       NetworkManager's general status and operations\n"
@@ -228,9 +219,9 @@ process_command_line (NmCli *nmc, int argc, char **argv)
 	if (argc > 1 && nm_streq (argv[1], "--complete-args")) {
 		nmc->complete = TRUE;
 		argv[1] = argv[0];
-		argc--; argv++;
+		next_arg (nmc, &argc, &argv, NULL);
 	}
-	argc--; argv++;
+	next_arg (nmc, &argc, &argv, NULL);
 
 	/* parse options */
 	while (argc) {
@@ -240,20 +231,20 @@ process_command_line (NmCli *nmc, int argc, char **argv)
 
 		if (argc == 1 && nmc->complete) {
 			nmc_complete_strings (opt, "--terse", "--pretty", "--mode", "--colors", "--escape",
-			                           "--fields", "--nocheck", "--ask", "--show-secrets",
-			                           "--wait", "--version", "--help", NULL);
+			                           "--fields", "--nocheck", "--get-values",
+			                            "--wait", "--version", "--help", NULL);
 		}
 
 		if (opt[1] == '-') {
 			opt++;
 			/* '--' ends options */
 			if (opt[1] == '\0') {
-				argc--; argv++;
+				next_arg (nmc, &argc, &argv, NULL);
 				break;
 			}
 		}
 
-		if (matches (opt, "-terse") == 0) {
+		if (matches (opt, "-terse")) {
 			if (nmc->print_output == NMC_PRINT_TERSE) {
 				g_string_printf (nmc->return_text, _("Error: Option '--terse' is specified the second time."));
 				nmc->return_value = NMC_RESULT_ERROR_USER_INPUT;
@@ -266,7 +257,7 @@ process_command_line (NmCli *nmc, int argc, char **argv)
 			}
 			else
 				nmc->print_output = NMC_PRINT_TERSE;
-		} else if (matches (opt, "-pretty") == 0) {
+		} else if (matches (opt, "-pretty")) {
 			if (nmc->print_output == NMC_PRINT_PRETTY) {
 				g_string_printf (nmc->return_text, _("Error: Option '--pretty' is specified the second time."));
 				nmc->return_value = NMC_RESULT_ERROR_USER_INPUT;
@@ -279,62 +270,70 @@ process_command_line (NmCli *nmc, int argc, char **argv)
 			}
 			else
 				nmc->print_output = NMC_PRINT_PRETTY;
-		} else if (matches (opt, "-mode") == 0) {
+		} else if (matches (opt, "-mode")) {
 			nmc->mode_specified = TRUE;
-			if (next_arg (&argc, &argv) != 0) {
+			argc--;
+			argv++;
+			if (!argc) {
 				g_string_printf (nmc->return_text, _("Error: missing argument for '%s' option."), opt);
 				nmc->return_value = NMC_RESULT_ERROR_USER_INPUT;
 				return FALSE;
 			}
 			if (argc == 1 && nmc->complete)
 				nmc_complete_strings (argv[0], "tabular", "multiline", NULL);
-			if (matches (argv[0], "tabular") == 0)
+			if (matches (argv[0], "tabular"))
 				nmc->multiline_output = FALSE;
-			else if (matches (argv[0], "multiline") == 0)
+			else if (matches (argv[0], "multiline"))
 				nmc->multiline_output = TRUE;
 			else {
 				g_string_printf (nmc->return_text, _("Error: '%s' is not valid argument for '%s' option."), argv[0], opt);
 				nmc->return_value = NMC_RESULT_ERROR_USER_INPUT;
 				return FALSE;
 			}
-		} else if (matches (opt, "-colors") == 0) {
-			if (next_arg (&argc, &argv) != 0) {
+		} else if (matches (opt, "-colors")) {
+			argc--;
+			argv++;
+			if (!argc) {
 				g_string_printf (nmc->return_text, _("Error: missing argument for '%s' option."), opt);
 				nmc->return_value = NMC_RESULT_ERROR_USER_INPUT;
 				return FALSE;
 			}
 			if (argc == 1 && nmc->complete)
 				nmc_complete_strings (argv[0], "yes", "no", "auto", NULL);
-			if (matches (argv[0], "auto") == 0)
+			if (matches (argv[0], "auto"))
 				nmc->use_colors = NMC_USE_COLOR_AUTO;
-			else if (matches (argv[0], "yes") == 0)
+			else if (matches (argv[0], "yes"))
 				nmc->use_colors = NMC_USE_COLOR_YES;
-			else if (matches (argv[0], "no") == 0)
+			else if (matches (argv[0], "no"))
 				nmc->use_colors = NMC_USE_COLOR_NO;
 			else {
 				g_string_printf (nmc->return_text, _("Error: '%s' is not valid argument for '%s' option."), argv[0], opt);
 				nmc->return_value = NMC_RESULT_ERROR_USER_INPUT;
 				return FALSE;
 			}
-		} else if (matches (opt, "-escape") == 0) {
-			if (next_arg (&argc, &argv) != 0) {
+		} else if (matches (opt, "-escape")) {
+			argc--;
+			argv++;
+			if (!argc) {
 				g_string_printf (nmc->return_text, _("Error: missing argument for '%s' option."), opt);
 				nmc->return_value = NMC_RESULT_ERROR_USER_INPUT;
 				return FALSE;
 			}
 			if (argc == 1 && nmc->complete)
 				nmc_complete_strings (argv[0], "yes", "no", NULL);
-			if (matches (argv[0], "yes") == 0)
+			if (matches (argv[0], "yes"))
 				nmc->escape_values = TRUE;
-			else if (matches (argv[0], "no") == 0)
+			else if (matches (argv[0], "no"))
 				nmc->escape_values = FALSE;
 			else {
 				g_string_printf (nmc->return_text, _("Error: '%s' is not valid argument for '%s' option."), argv[0], opt);
 				nmc->return_value = NMC_RESULT_ERROR_USER_INPUT;
 				return FALSE;
 			}
-		} else if (matches (opt, "-fields") == 0) {
-			if (next_arg (&argc, &argv) != 0) {
+		} else if (matches (opt, "-fields")) {
+			argc--;
+			argv++;
+			if (!argc) {
 				g_string_printf (nmc->return_text, _("Error: fields for '%s' options are missing."), opt);
 				nmc->return_value = NMC_RESULT_ERROR_USER_INPUT;
 				return FALSE;
@@ -342,15 +341,31 @@ process_command_line (NmCli *nmc, int argc, char **argv)
 			if (argc == 1 && nmc->complete)
 				complete_fields (argv[0]);
 			nmc->required_fields = g_strdup (argv[0]);
-		} else if (matches (opt, "-nocheck") == 0) {
+		} else if (matches (opt, "-get-values")) {
+			argc--;
+			argv++;
+			if (!argc) {
+				g_string_printf (nmc->return_text, _("Error: fields for '%s' options are missing."), opt);
+				nmc->return_value = NMC_RESULT_ERROR_USER_INPUT;
+				return FALSE;
+			}
+			if (argc == 1 && nmc->complete)
+				complete_fields (argv[0]);
+			nmc->required_fields = g_strdup (argv[0]);
+			nmc->print_output = NMC_PRINT_TERSE;
+			/* We want fixed tabular mode here, but just set the mode specified and rely on the initialization
+			 * in nmc_init: in this way we allow use of "-m multiline" to swap the output mode also if placed
+			 * before the "-g <field>" option (-g may be still more practical and easy to remember than -t -f).
+			*/
+			nmc->mode_specified = TRUE;
+		} else if (matches (opt, "-nocheck")) {
 			/* ignore for backward compatibility */
-		} else if (matches (opt, "-ask") == 0) {
-			nmc->ask = TRUE;
-		} else if (matches (opt, "-show-secrets") == 0) {
-			nmc->show_secrets = TRUE;
-		} else if (matches (opt, "-wait") == 0) {
+		} else if (matches (opt, "-wait")) {
 			unsigned long timeout;
-			if (next_arg (&argc, &argv) != 0) {
+
+			argc--;
+			argv++;
+			if (!argc) {
 				g_string_printf (nmc->return_text, _("Error: missing argument for '%s' option."), opt);
 				nmc->return_value = NMC_RESULT_ERROR_USER_INPUT;
 				return FALSE;
@@ -362,11 +377,11 @@ process_command_line (NmCli *nmc, int argc, char **argv)
 				return FALSE;
 			}
 			nmc->timeout = (int) timeout;
-		} else if (matches (opt, "-version") == 0) {
+		} else if (matches (opt, "-version")) {
 			if (!nmc->complete)
 				g_print (_("nmcli tool, version %s\n"), NMCLI_VERSION);
 			return NMC_RESULT_SUCCESS;
-		} else if (matches (opt, "-help") == 0) {
+		} else if (matches (opt, "-help")) {
 			if (!nmc->complete)
 				usage ();
 			return NMC_RESULT_SUCCESS;
@@ -375,8 +390,7 @@ process_command_line (NmCli *nmc, int argc, char **argv)
 			nmc->return_value = NMC_RESULT_ERROR_USER_INPUT;
 			return FALSE;
 		}
-		argc--;
-		argv++;
+		next_arg (nmc, &argc, &argv, NULL);
 	}
 
 	/* Now run the requested command */
diff --git a/clients/cli/nmcli.h b/clients/cli/nmcli.h
index 30600d21..7e33e3a7 100644
--- a/clients/cli/nmcli.h
+++ b/clients/cli/nmcli.h
@@ -20,8 +20,8 @@
 #ifndef NMC_NMCLI_H
 #define NMC_NMCLI_H
 
-#include <NetworkManager.h>
-#include <nm-secret-agent-old.h>
+#include "NetworkManager.h"
+#include "nm-secret-agent-old.h"
 
 #if WITH_POLKIT_AGENT
 #include "nm-polkit-listener.h"
diff --git a/clients/cli/settings-docs.c b/clients/cli/settings-docs.c
index 2520ba0e..3d9e7aa9 100644
--- a/clients/cli/settings-docs.c
+++ b/clients/cli/settings-docs.c
@@ -56,9 +56,14 @@ NmcPropertyDesc setting_802_11_wireless_security[] = {
 NmcPropertyDesc setting_802_1x[] = {
 	{ "altsubject-matches", "List of strings to be matched against the altSubjectName of the certificate presented by the authentication server. If the list is empty, no verification of the server certificate's altSubjectName is performed." },
 	{ "anonymous-identity", "Anonymous identity string for EAP authentication methods.  Used as the unencrypted identity with EAP types that support different tunneled identity like EAP-TTLS." },
+	{ "auth-timeout", "A timeout for the authentication. Zero means the global default; if the global default is not set, the authentication timeout is 25 seconds." },
 	{ "ca-cert", "Contains the CA certificate if used by the EAP method specified in the \"eap\" property. Certificate data is specified using a \"scheme\"; two are currently supported: blob and path. When using the blob scheme (which is backwards compatible with NM 0.7.x) this property should be set to the certificate's DER encoded data. When using the path scheme, this property should be set to the full UTF-8 encoded path of the certificate, prefixed with the string \"file://\" and ending with a terminating NUL byte. This property can be unset even if the EAP method supports CA certificates, but this allows man-in-the-middle attacks and is NOT recommended." },
+	{ "ca-cert-password", "The password used to access the CA certificate stored in \"ca-cert\" property. Only makes sense if the certificate is stored on a PKCS#11 token that requires a login." },
+	{ "ca-cert-password-flags", "Flags indicating how to handle the \"ca-cert-password\" property." },
 	{ "ca-path", "UTF-8 encoded path to a directory containing PEM or DER formatted certificates to be added to the verification chain in addition to the certificate specified in the \"ca-cert\" property." },
 	{ "client-cert", "Contains the client certificate if used by the EAP method specified in the \"eap\" property. Certificate data is specified using a \"scheme\"; two are currently supported: blob and path. When using the blob scheme (which is backwards compatible with NM 0.7.x) this property should be set to the certificate's DER encoded data. When using the path scheme, this property should be set to the full UTF-8 encoded path of the certificate, prefixed with the string \"file://\" and ending with a terminating NUL byte." },
+	{ "client-cert-password", "The password used to access the client certificate stored in \"client-cert\" property. Only makes sense if the certificate is stored on a PKCS#11 token that requires a login." },
+	{ "client-cert-password-flags", "Flags indicating how to handle the \"client-cert-password\" property." },
 	{ "domain-suffix-match", "Constraint for server domain name. If set, this FQDN is used as a suffix match requirement for dNSName element(s) of the certificate presented by the authentication server.  If a matching dNSName is found, this constraint is met.  If no dNSName values are present, this constraint is matched against SubjectName CN using same suffix match comparison." },
 	{ "eap", "The allowed EAP method to be used when authenticating to the network with 802.1x.  Valid methods are: \"leap\", \"md5\", \"tls\", \"peap\", \"ttls\", \"pwd\", and \"fast\".  Each method requires different configuration using the properties of this setting; refer to wpa_supplicant documentation for the allowed combinations." },
 	{ "identity", "Identity string for EAP authentication methods.  Often the user's user or login name." },
@@ -68,6 +73,7 @@ NmcPropertyDesc setting_802_1x[] = {
 	{ "password-flags", "Flags indicating how to handle the \"password\" property." },
 	{ "password-raw", "Password used for EAP authentication methods, given as a byte array to allow passwords in other encodings than UTF-8 to be used. If both the \"password\" property and the \"password-raw\" property are specified, \"password\" is preferred." },
 	{ "password-raw-flags", "Flags indicating how to handle the \"password-raw\" property." },
+	{ "phase1-auth-flags", "Specifies authentication flags to use in \"phase 1\" outer authentication using NMSetting8021xAuthFlags options. The invidual TLS versions can be explicitly disabled. If a certain TLS disable flag is not set, it is up to the supplicant to allow or forbid it. The TLS options map to tls_disable_tlsv1_x settings. See the wpa_supplicant documentation for more details." },
 	{ "phase1-fast-provisioning", "Enables or disables in-line provisioning of EAP-FAST credentials when FAST is specified as the EAP method in the \"eap\" property. Recognized values are \"0\" (disabled), \"1\" (allow unauthenticated provisioning), \"2\" (allow authenticated provisioning), and \"3\" (allow both authenticated and unauthenticated provisioning).  See the wpa_supplicant documentation for more details." },
 	{ "phase1-peaplabel", "Forces use of the new PEAP label during key derivation.  Some RADIUS servers may require forcing the new PEAP label to interoperate with PEAPv1.  Set to \"1\" to force use of the new PEAP label.  See the wpa_supplicant documentation for more details." },
 	{ "phase1-peapver", "Forces which PEAP version is used when PEAP is set as the EAP method in the \"eap\" property.  When unset, the version reported by the server will be used.  Sometimes when using older RADIUS servers, it is necessary to force the client to use a particular PEAP version.  To do so, this property may be set to \"0\" or \"1\" to force that specific PEAP version." },
@@ -75,16 +81,20 @@ NmcPropertyDesc setting_802_1x[] = {
 	{ "phase2-auth", "Specifies the allowed \"phase 2\" inner non-EAP authentication methods when an EAP method that uses an inner TLS tunnel is specified in the \"eap\" property.  Recognized non-EAP \"phase 2\" methods are \"pap\", \"chap\", \"mschap\", \"mschapv2\", \"gtc\", \"otp\", \"md5\", and \"tls\". Each \"phase 2\" inner method requires specific parameters for successful authentication; see the wpa_supplicant documentation for more details." },
 	{ "phase2-autheap", "Specifies the allowed \"phase 2\" inner EAP-based authentication methods when an EAP method that uses an inner TLS tunnel is specified in the \"eap\" property.  Recognized EAP-based \"phase 2\" methods are \"md5\", \"mschapv2\", \"otp\", \"gtc\", and \"tls\". Each \"phase 2\" inner method requires specific parameters for successful authentication; see the wpa_supplicant documentation for more details." },
 	{ "phase2-ca-cert", "Contains the \"phase 2\" CA certificate if used by the EAP method specified in the \"phase2-auth\" or \"phase2-autheap\" properties. Certificate data is specified using a \"scheme\"; two are currently supported: blob and path. When using the blob scheme (which is backwards compatible with NM 0.7.x) this property should be set to the certificate's DER encoded data. When using the path scheme, this property should be set to the full UTF-8 encoded path of the certificate, prefixed with the string \"file://\" and ending with a terminating NUL byte. This property can be unset even if the EAP method supports CA certificates, but this allows man-in-the-middle attacks and is NOT recommended." },
+	{ "phase2-ca-cert-password", "The password used to access the \"phase2\" CA certificate stored in \"phase2-ca-cert\" property. Only makes sense if the certificate is stored on a PKCS#11 token that requires a login." },
+	{ "phase2-ca-cert-password-flags", "Flags indicating how to handle the \"phase2-ca-cert-password\" property." },
 	{ "phase2-ca-path", "UTF-8 encoded path to a directory containing PEM or DER formatted certificates to be added to the verification chain in addition to the certificate specified in the \"phase2-ca-cert\" property." },
 	{ "phase2-client-cert", "Contains the \"phase 2\" client certificate if used by the EAP method specified in the \"phase2-auth\" or \"phase2-autheap\" properties. Certificate data is specified using a \"scheme\"; two are currently supported: blob and path. When using the blob scheme (which is backwards compatible with NM 0.7.x) this property should be set to the certificate's DER encoded data. When using the path scheme, this property should be set to the full UTF-8 encoded path of the certificate, prefixed with the string \"file://\" and ending with a terminating NUL byte. This property can be unset even if the EAP method supports CA certificates, but this allows man-in-the-middle attacks and is NOT recommended." },
+	{ "phase2-client-cert-password", "The password used to access the \"phase2\" client certificate stored in \"phase2-client-cert\" property. Only makes sense if the certificate is stored on a PKCS#11 token that requires a login." },
+	{ "phase2-client-cert-password-flags", "Flags indicating how to handle the \"phase2-client-cert-password\" property." },
 	{ "phase2-domain-suffix-match", "Constraint for server domain name. If set, this FQDN is used as a suffix match requirement for dNSName element(s) of the certificate presented by the authentication server during the inner \"phase 2\" authentication.  If a matching dNSName is found, this constraint is met.  If no dNSName values are present, this constraint is matched against SubjectName CN using same suffix match comparison." },
-	{ "phase2-private-key", "Contains the \"phase 2\" inner private key when the \"phase2-auth\" or \"phase2-autheap\" property is set to \"tls\". Key data is specified using a \"scheme\"; two are currently supported: blob and path. When using the blob scheme and private keys, this property should be set to the key's encrypted PEM encoded data. When using private keys with the path scheme, this property should be set to the full UTF-8 encoded path of the key, prefixed with the string \"file://\" and ending with a terminating NUL byte. When using PKCS#12 format private keys and the blob scheme, this property should be set to the PKCS#12 data and the \"phase2-private-key-password\" property must be set to password used to decrypt the PKCS#12 certificate and key. When using PKCS#12 files and the path scheme, this property should be set to the full UTF-8 encoded path of the key, prefixed with the string \"file://\" and and ending with a terminating NUL byte, and as with the blob scheme the \"phase2-private-key-password\" property must be set to the password used to decode the PKCS#12 private key and certificate." },
+	{ "phase2-private-key", "Contains the \"phase 2\" inner private key when the \"phase2-auth\" or \"phase2-autheap\" property is set to \"tls\". Key data is specified using a \"scheme\"; two are currently supported: blob and path. When using the blob scheme and private keys, this property should be set to the key's encrypted PEM encoded data. When using private keys with the path scheme, this property should be set to the full UTF-8 encoded path of the key, prefixed with the string \"file://\" and ending with a terminating NUL byte. When using PKCS#12 format private keys and the blob scheme, this property should be set to the PKCS#12 data and the \"phase2-private-key-password\" property must be set to password used to decrypt the PKCS#12 certificate and key. When using PKCS#12 files and the path scheme, this property should be set to the full UTF-8 encoded path of the key, prefixed with the string \"file://\" and ending with a terminating NUL byte, and as with the blob scheme the \"phase2-private-key-password\" property must be set to the password used to decode the PKCS#12 private key and certificate." },
 	{ "phase2-private-key-password", "The password used to decrypt the \"phase 2\" private key specified in the \"phase2-private-key\" property when the private key either uses the path scheme, or is a PKCS#12 format key." },
 	{ "phase2-private-key-password-flags", "Flags indicating how to handle the \"phase2-private-key-password\" property." },
 	{ "phase2-subject-match", "Substring to be matched against the subject of the certificate presented by the authentication server during the inner \"phase 2\" authentication. When unset, no verification of the authentication server certificate's subject is performed.  This property provides little security, if any, and its use is deprecated in favor of NMSetting8021x:phase2-domain-suffix-match." },
 	{ "pin", "PIN used for EAP authentication methods." },
 	{ "pin-flags", "Flags indicating how to handle the \"pin\" property." },
-	{ "private-key", "Contains the private key when the \"eap\" property is set to \"tls\". Key data is specified using a \"scheme\"; two are currently supported: blob and path. When using the blob scheme and private keys, this property should be set to the key's encrypted PEM encoded data. When using private keys with the path scheme, this property should be set to the full UTF-8 encoded path of the key, prefixed with the string \"file://\" and ending with a terminating NUL byte. When using PKCS#12 format private keys and the blob scheme, this property should be set to the PKCS#12 data and the \"private-key-password\" property must be set to password used to decrypt the PKCS#12 certificate and key. When using PKCS#12 files and the path scheme, this property should be set to the full UTF-8 encoded path of the key, prefixed with the string \"file://\" and and ending with a terminating NUL byte, and as with the blob scheme the \"private-key-password\" property must be set to the password used to decode the PKCS#12 private key and certificate. WARNING: \"private-key\" is not a \"secret\" property, and thus unencrypted private key data using the BLOB scheme may be readable by unprivileged users.  Private keys should always be encrypted with a private key password to prevent unauthorized access to unencrypted private key data." },
+	{ "private-key", "Contains the private key when the \"eap\" property is set to \"tls\". Key data is specified using a \"scheme\"; two are currently supported: blob and path. When using the blob scheme and private keys, this property should be set to the key's encrypted PEM encoded data. When using private keys with the path scheme, this property should be set to the full UTF-8 encoded path of the key, prefixed with the string \"file://\" and ending with a terminating NUL byte. When using PKCS#12 format private keys and the blob scheme, this property should be set to the PKCS#12 data and the \"private-key-password\" property must be set to password used to decrypt the PKCS#12 certificate and key. When using PKCS#12 files and the path scheme, this property should be set to the full UTF-8 encoded path of the key, prefixed with the string \"file://\" and ending with a terminating NUL byte, and as with the blob scheme the \"private-key-password\" property must be set to the password used to decode the PKCS#12 private key and certificate. WARNING: \"private-key\" is not a \"secret\" property, and thus unencrypted private key data using the BLOB scheme may be readable by unprivileged users.  Private keys should always be encrypted with a private key password to prevent unauthorized access to unencrypted private key data." },
 	{ "private-key-password", "The password used to decrypt the private key specified in the \"private-key\" property when the private key either uses the path scheme, or if the private key is a PKCS#12 format key." },
 	{ "private-key-password-flags", "Flags indicating how to handle the \"private-key-password\" property." },
 	{ "subject-match", "Substring to be matched against the subject of the certificate presented by the authentication server. When unset, no verification of the authentication server certificate's subject is performed.  This property provides little security, if any, and its use is deprecated in favor of NMSetting8021x:domain-suffix-match." },
@@ -151,6 +161,7 @@ NmcPropertyDesc setting_bridge_port[] = {
 };
   
 NmcPropertyDesc setting_cdma[] = {
+	{ "mtu", "If non-zero, only transmit packets of the specified size or smaller, breaking larger packets up into multiple frames." },
 	{ "name", "The setting's name, which uniquely identifies the setting within the connection.  Each setting type has a name unique to that type, for example \"ppp\" or \"wireless\" or \"wired\"." },
 	{ "number", "The number to dial to establish the connection to the CDMA-based mobile broadband network, if any.  If not specified, the default number (#777) is used when required." },
 	{ "password", "The password used to authenticate with the network, if required.  Many providers do not require a password, or accept any password.  But if a password is required, it is specified here." },
@@ -200,6 +211,10 @@ NmcPropertyDesc setting_dcb[] = {
 	{ "priority-traffic-class", "An array of 8 uint values, where the array index corresponds to the User Priority (0 - 7) and the value indicates the traffic class (0 - 7) to which the priority is mapped." },
 };
   
+NmcPropertyDesc setting_dummy[] = {
+	{ "name", "The setting's name, which uniquely identifies the setting within the connection.  Each setting type has a name unique to that type, for example \"ppp\" or \"wireless\" or \"wired\"." },
+};
+  
 NmcPropertyDesc setting_generic[] = {
 	{ "name", "The setting's name, which uniquely identifies the setting within the connection.  Each setting type has a name unique to that type, for example \"ppp\" or \"wireless\" or \"wired\"." },
 };
@@ -208,6 +223,7 @@ NmcPropertyDesc setting_gsm[] = {
 	{ "apn", "The GPRS Access Point Name specifying the APN used when establishing a data session with the GSM-based network.  The APN often determines how the user will be billed for their network usage and whether the user has access to the Internet or just a provider-specific walled-garden, so it is important to use the correct APN for the user's mobile broadband plan. The APN may only be composed of the characters a-z, 0-9, ., and - per GSM 03.60 Section 14.9." },
 	{ "device-id", "The device unique identifier (as given by the WWAN management service) which this connection applies to.  If given, the connection will only apply to the specified device." },
 	{ "home-only", "When TRUE, only connections to the home network will be allowed. Connections to roaming networks will not be made." },
+	{ "mtu", "If non-zero, only transmit packets of the specified size or smaller, breaking larger packets up into multiple frames." },
 	{ "name", "The setting's name, which uniquely identifies the setting within the connection.  Each setting type has a name unique to that type, for example \"ppp\" or \"wireless\" or \"wired\"." },
 	{ "network-id", "The Network ID (GSM LAI format, ie MCC-MNC) to force specific network registration.  If the Network ID is specified, NetworkManager will attempt to force the device to register only on the specified network. This can be used to ensure that the device does not roam when direct roaming control of the device is not otherwise possible." },
 	{ "number", "Number to dial when establishing a PPP data session with the GSM-based mobile broadband network.  Many modems do not require PPP for connections to the mobile network and thus this property should be left blank, which allows NetworkManager to select the appropriate settings automatically." },
@@ -379,6 +395,11 @@ NmcPropertyDesc setting_tun[] = {
 	{ "vnet-hdr", "If TRUE the IFF_VNET_HDR the tunnel packets will include a virtio network header." },
 };
   
+NmcPropertyDesc setting_user[] = {
+	{ "data", "A dictionary of key/value pairs with user data. This data is ignored by NetworkManager and can be used at the users discretion. The keys only support a strict ascii format, but the values can be arbitrary UTF8 strings up to a certain length." },
+	{ "name", "The setting's name, which uniquely identifies the setting within the connection.  Each setting type has a name unique to that type, for example \"ppp\" or \"wireless\" or \"wired\"." },
+};
+  
 NmcPropertyDesc setting_vlan[] = {
 	{ "egress-priority-map", "For outgoing packets, a list of mappings from Linux SKB priorities to 802.1p priorities.  The mapping is given in the format \"from:to\" where both \"from\" and \"to\" are unsigned integers, ie \"7:3\"." },
 	{ "flags", "One or more flags which control the behavior and features of the VLAN interface.  Flags include NM_VLAN_FLAG_REORDER_HEADERS (0x1) (reordering of output packet headers), NM_VLAN_FLAG_GVRP (0x2) (use of the GVRP protocol), and NM_VLAN_FLAG_LOOSE_BINDING (0x4) (loose binding of the interface to its master device's operating state). NM_VLAN_FLAG_MVRP (0x8) (use of the MVRP protocol). The default value of this property is NM_VLAN_FLAG_REORDER_HEADERS, but it used to be 0. To preserve backward compatibility, the default-value in the D-Bus API continues to be 0 and a missing property on D-Bus is still considered as 0." },
@@ -436,18 +457,19 @@ NmcSettingDesc all_settings[] = {
 	{ "802-11-olpc-mesh", setting_802_11_olpc_mesh, 4 },
 	{ "802-11-wireless", setting_802_11_wireless, 17 },
 	{ "802-11-wireless-security", setting_802_11_wireless_security, 18 },
-	{ "802-1x", setting_802_1x, 35 },
+	{ "802-1x", setting_802_1x, 45 },
 	{ "802-3-ethernet", setting_802_3_ethernet, 15 },
 	{ "adsl", setting_adsl, 8 },
 	{ "bluetooth", setting_bluetooth, 3 },
 	{ "bond", setting_bond, 2 },
 	{ "bridge", setting_bridge, 9 },
 	{ "bridge-port", setting_bridge_port, 4 },
-	{ "cdma", setting_cdma, 5 },
+	{ "cdma", setting_cdma, 6 },
 	{ "connection", setting_connection, 20 },
 	{ "dcb", setting_dcb, 16 },
+	{ "dummy", setting_dummy, 1 },
 	{ "generic", setting_generic, 1 },
-	{ "gsm", setting_gsm, 13 },
+	{ "gsm", setting_gsm, 14 },
 	{ "infiniband", setting_infiniband, 6 },
 	{ "ip-tunnel", setting_ip_tunnel, 13 },
 	{ "ipv4", setting_ipv4, 20 },
@@ -461,6 +483,7 @@ NmcSettingDesc all_settings[] = {
 	{ "team", setting_team, 2 },
 	{ "team-port", setting_team_port, 2 },
 	{ "tun", setting_tun, 7 },
+	{ "user", setting_user, 2 },
 	{ "vlan", setting_vlan, 6 },
 	{ "vpn", setting_vpn, 7 },
 	{ "vxlan", setting_vxlan, 17 },
diff --git a/clients/cli/settings.c b/clients/cli/settings.c
index 1c8d5462..87b1f50f 100644
--- a/clients/cli/settings.c
+++ b/clients/cli/settings.c
@@ -128,35 +128,45 @@ NmcOutputField nmc_fields_setting_8021X[] = {
 	SETTING_FIELD (NM_SETTING_802_1X_ANONYMOUS_IDENTITY),                 /* 3 */
 	SETTING_FIELD (NM_SETTING_802_1X_PAC_FILE),                           /* 4 */
 	SETTING_FIELD (NM_SETTING_802_1X_CA_CERT),                            /* 5 */
-	SETTING_FIELD (NM_SETTING_802_1X_CA_PATH),                            /* 6 */
-	SETTING_FIELD (NM_SETTING_802_1X_SUBJECT_MATCH),                      /* 7 */
-	SETTING_FIELD (NM_SETTING_802_1X_ALTSUBJECT_MATCHES),                 /* 8 */
-	SETTING_FIELD (NM_SETTING_802_1X_DOMAIN_SUFFIX_MATCH),                /* 9 */
-	SETTING_FIELD (NM_SETTING_802_1X_CLIENT_CERT),                        /* 10 */
-	SETTING_FIELD (NM_SETTING_802_1X_PHASE1_PEAPVER),                     /* 11 */
-	SETTING_FIELD (NM_SETTING_802_1X_PHASE1_PEAPLABEL),                   /* 12 */
-	SETTING_FIELD (NM_SETTING_802_1X_PHASE1_FAST_PROVISIONING),           /* 13 */
-	SETTING_FIELD (NM_SETTING_802_1X_PHASE2_AUTH),                        /* 14 */
-	SETTING_FIELD (NM_SETTING_802_1X_PHASE2_AUTHEAP),                     /* 15 */
-	SETTING_FIELD (NM_SETTING_802_1X_PHASE2_CA_CERT),                     /* 16 */
-	SETTING_FIELD (NM_SETTING_802_1X_PHASE2_CA_PATH),                     /* 17 */
-	SETTING_FIELD (NM_SETTING_802_1X_PHASE2_SUBJECT_MATCH),               /* 18 */
-	SETTING_FIELD (NM_SETTING_802_1X_PHASE2_ALTSUBJECT_MATCHES),          /* 19 */
-	SETTING_FIELD (NM_SETTING_802_1X_PHASE2_DOMAIN_SUFFIX_MATCH),         /* 20 */
-	SETTING_FIELD (NM_SETTING_802_1X_PHASE2_CLIENT_CERT),                 /* 21 */
-	SETTING_FIELD (NM_SETTING_802_1X_PASSWORD),                           /* 22 */
-	SETTING_FIELD (NM_SETTING_802_1X_PASSWORD_FLAGS),                     /* 23 */
-	SETTING_FIELD (NM_SETTING_802_1X_PASSWORD_RAW),                       /* 24 */
-	SETTING_FIELD (NM_SETTING_802_1X_PASSWORD_RAW_FLAGS),                 /* 25 */
-	SETTING_FIELD (NM_SETTING_802_1X_PRIVATE_KEY),                        /* 26 */
-	SETTING_FIELD (NM_SETTING_802_1X_PRIVATE_KEY_PASSWORD),               /* 27 */
-	SETTING_FIELD (NM_SETTING_802_1X_PRIVATE_KEY_PASSWORD_FLAGS),         /* 28 */
-	SETTING_FIELD (NM_SETTING_802_1X_PHASE2_PRIVATE_KEY),                 /* 29 */
-	SETTING_FIELD (NM_SETTING_802_1X_PHASE2_PRIVATE_KEY_PASSWORD),        /* 30 */
-	SETTING_FIELD (NM_SETTING_802_1X_PHASE2_PRIVATE_KEY_PASSWORD_FLAGS),  /* 31 */
-	SETTING_FIELD (NM_SETTING_802_1X_PIN),                                /* 32 */
-	SETTING_FIELD (NM_SETTING_802_1X_PIN_FLAGS),                          /* 33 */
-	SETTING_FIELD (NM_SETTING_802_1X_SYSTEM_CA_CERTS),                    /* 34 */
+	SETTING_FIELD (NM_SETTING_802_1X_CA_CERT_PASSWORD),                   /* 6 */
+	SETTING_FIELD (NM_SETTING_802_1X_CA_CERT_PASSWORD_FLAGS),             /* 7 */
+	SETTING_FIELD (NM_SETTING_802_1X_CA_PATH),                            /* 8 */
+	SETTING_FIELD (NM_SETTING_802_1X_SUBJECT_MATCH),                      /* 9 */
+	SETTING_FIELD (NM_SETTING_802_1X_ALTSUBJECT_MATCHES),                 /* 10 */
+	SETTING_FIELD (NM_SETTING_802_1X_DOMAIN_SUFFIX_MATCH),                /* 11 */
+	SETTING_FIELD (NM_SETTING_802_1X_CLIENT_CERT),                        /* 12 */
+	SETTING_FIELD (NM_SETTING_802_1X_CLIENT_CERT_PASSWORD),               /* 13 */
+	SETTING_FIELD (NM_SETTING_802_1X_CLIENT_CERT_PASSWORD_FLAGS),         /* 14 */
+	SETTING_FIELD (NM_SETTING_802_1X_PHASE1_PEAPVER),                     /* 15 */
+	SETTING_FIELD (NM_SETTING_802_1X_PHASE1_PEAPLABEL),                   /* 16 */
+	SETTING_FIELD (NM_SETTING_802_1X_PHASE1_FAST_PROVISIONING),           /* 17 */
+	SETTING_FIELD (NM_SETTING_802_1X_PHASE1_AUTH_FLAGS),                  /* 18 */
+	SETTING_FIELD (NM_SETTING_802_1X_PHASE2_AUTH),                        /* 19 */
+	SETTING_FIELD (NM_SETTING_802_1X_PHASE2_AUTHEAP),                     /* 20 */
+	SETTING_FIELD (NM_SETTING_802_1X_PHASE2_CA_CERT_PASSWORD),            /* 21 */
+	SETTING_FIELD (NM_SETTING_802_1X_PHASE2_CA_CERT_PASSWORD_FLAGS),      /* 22 */
+	SETTING_FIELD (NM_SETTING_802_1X_PHASE2_CA_CERT),                     /* 23 */
+	SETTING_FIELD (NM_SETTING_802_1X_PHASE2_CA_PATH),                     /* 24 */
+	SETTING_FIELD (NM_SETTING_802_1X_PHASE2_SUBJECT_MATCH),               /* 25 */
+	SETTING_FIELD (NM_SETTING_802_1X_PHASE2_ALTSUBJECT_MATCHES),          /* 26 */
+	SETTING_FIELD (NM_SETTING_802_1X_PHASE2_DOMAIN_SUFFIX_MATCH),         /* 27 */
+	SETTING_FIELD (NM_SETTING_802_1X_PHASE2_CLIENT_CERT),                 /* 28 */
+	SETTING_FIELD (NM_SETTING_802_1X_PHASE2_CLIENT_CERT_PASSWORD),        /* 29 */
+	SETTING_FIELD (NM_SETTING_802_1X_PHASE2_CLIENT_CERT_PASSWORD_FLAGS),  /* 30 */
+	SETTING_FIELD (NM_SETTING_802_1X_PASSWORD),                           /* 31 */
+	SETTING_FIELD (NM_SETTING_802_1X_PASSWORD_FLAGS),                     /* 32 */
+	SETTING_FIELD (NM_SETTING_802_1X_PASSWORD_RAW),                       /* 33 */
+	SETTING_FIELD (NM_SETTING_802_1X_PASSWORD_RAW_FLAGS),                 /* 34 */
+	SETTING_FIELD (NM_SETTING_802_1X_PRIVATE_KEY),                        /* 35 */
+	SETTING_FIELD (NM_SETTING_802_1X_PRIVATE_KEY_PASSWORD),               /* 36 */
+	SETTING_FIELD (NM_SETTING_802_1X_PRIVATE_KEY_PASSWORD_FLAGS),         /* 37 */
+	SETTING_FIELD (NM_SETTING_802_1X_PHASE2_PRIVATE_KEY),                 /* 38 */
+	SETTING_FIELD (NM_SETTING_802_1X_PHASE2_PRIVATE_KEY_PASSWORD),        /* 39 */
+	SETTING_FIELD (NM_SETTING_802_1X_PHASE2_PRIVATE_KEY_PASSWORD_FLAGS),  /* 40 */
+	SETTING_FIELD (NM_SETTING_802_1X_PIN),                                /* 41 */
+	SETTING_FIELD (NM_SETTING_802_1X_PIN_FLAGS),                          /* 42 */
+	SETTING_FIELD (NM_SETTING_802_1X_SYSTEM_CA_CERTS),                    /* 43 */
+	SETTING_FIELD (NM_SETTING_802_1X_AUTH_TIMEOUT),                       /* 44 */
 	{NULL, NULL, 0, NULL, FALSE, FALSE, 0}
 };
 #define NMC_FIELDS_SETTING_802_1X_ALL     "name"","\
@@ -165,22 +175,31 @@ NmcOutputField nmc_fields_setting_8021X[] = {
                                           NM_SETTING_802_1X_ANONYMOUS_IDENTITY","\
                                           NM_SETTING_802_1X_PAC_FILE","\
                                           NM_SETTING_802_1X_CA_CERT","\
+                                          NM_SETTING_802_1X_CA_CERT_PASSWORD","\
+                                          NM_SETTING_802_1X_CA_CERT_PASSWORD_FLAGS","\
                                           NM_SETTING_802_1X_CA_PATH","\
                                           NM_SETTING_802_1X_SUBJECT_MATCH","\
                                           NM_SETTING_802_1X_ALTSUBJECT_MATCHES","\
                                           NM_SETTING_802_1X_DOMAIN_SUFFIX_MATCH","\
                                           NM_SETTING_802_1X_CLIENT_CERT","\
+                                          NM_SETTING_802_1X_CLIENT_CERT_PASSWORD","\
+                                          NM_SETTING_802_1X_CLIENT_CERT_PASSWORD_FLAGS","\
                                           NM_SETTING_802_1X_PHASE1_PEAPVER","\
                                           NM_SETTING_802_1X_PHASE1_PEAPLABEL","\
                                           NM_SETTING_802_1X_PHASE1_FAST_PROVISIONING","\
+                                          NM_SETTING_802_1X_PHASE1_AUTH_FLAGS","\
                                           NM_SETTING_802_1X_PHASE2_AUTH","\
                                           NM_SETTING_802_1X_PHASE2_AUTHEAP","\
                                           NM_SETTING_802_1X_PHASE2_CA_CERT","\
+                                          NM_SETTING_802_1X_PHASE2_CA_CERT_PASSWORD","\
+                                          NM_SETTING_802_1X_PHASE2_CA_CERT_PASSWORD_FLAGS","\
                                           NM_SETTING_802_1X_PHASE2_CA_PATH","\
                                           NM_SETTING_802_1X_PHASE2_SUBJECT_MATCH","\
                                           NM_SETTING_802_1X_PHASE2_ALTSUBJECT_MATCHES","\
                                           NM_SETTING_802_1X_PHASE2_DOMAIN_SUFFIX_MATCH","\
                                           NM_SETTING_802_1X_PHASE2_CLIENT_CERT","\
+                                          NM_SETTING_802_1X_PHASE2_CLIENT_CERT_PASSWORD","\
+                                          NM_SETTING_802_1X_PHASE2_CLIENT_CERT_PASSWORD_FLAGS","\
                                           NM_SETTING_802_1X_PASSWORD","\
                                           NM_SETTING_802_1X_PASSWORD_FLAGS","\
                                           NM_SETTING_802_1X_PASSWORD_RAW","\
@@ -193,7 +212,8 @@ NmcOutputField nmc_fields_setting_8021X[] = {
                                           NM_SETTING_802_1X_PHASE2_PRIVATE_KEY_PASSWORD_FLAGS","\
                                           NM_SETTING_802_1X_PIN","\
                                           NM_SETTING_802_1X_PIN_FLAGS","\
-                                          NM_SETTING_802_1X_SYSTEM_CA_CERTS
+                                          NM_SETTING_802_1X_SYSTEM_CA_CERTS","\
+                                          NM_SETTING_802_1X_AUTH_TIMEOUT
 
 /* Available fields for NM_SETTING_WIRELESS_SETTING_NAME */
 NmcOutputField nmc_fields_setting_wireless[] = {
@@ -474,6 +494,7 @@ NmcOutputField nmc_fields_setting_gsm[] = {
 	SETTING_FIELD (NM_SETTING_GSM_DEVICE_ID),       /* 10 */
 	SETTING_FIELD (NM_SETTING_GSM_SIM_ID),          /* 11 */
 	SETTING_FIELD (NM_SETTING_GSM_SIM_OPERATOR_ID), /* 12 */
+	SETTING_FIELD (NM_SETTING_GSM_MTU),             /* 13 */
 	{NULL, NULL, 0, NULL, FALSE, FALSE, 0}
 };
 #define NMC_FIELDS_SETTING_GSM_ALL     "name"","\
@@ -488,7 +509,8 @@ NmcOutputField nmc_fields_setting_gsm[] = {
                                        NM_SETTING_GSM_HOME_ONLY","\
                                        NM_SETTING_GSM_DEVICE_ID","\
                                        NM_SETTING_GSM_SIM_ID","\
-                                       NM_SETTING_GSM_SIM_OPERATOR_ID
+                                       NM_SETTING_GSM_SIM_OPERATOR_ID","\
+                                       NM_SETTING_GSM_MTU
 
 /* Available fields for NM_SETTING_CDMA_SETTING_NAME */
 NmcOutputField nmc_fields_setting_cdma[] = {
@@ -497,13 +519,15 @@ NmcOutputField nmc_fields_setting_cdma[] = {
 	SETTING_FIELD (NM_SETTING_CDMA_USERNAME),        /* 2 */
 	SETTING_FIELD (NM_SETTING_CDMA_PASSWORD),        /* 3 */
 	SETTING_FIELD (NM_SETTING_CDMA_PASSWORD_FLAGS),  /* 4 */
+	SETTING_FIELD (NM_SETTING_CDMA_MTU),             /* 5 */
 	{NULL, NULL, 0, NULL, FALSE, FALSE, 0}
 };
 #define NMC_FIELDS_SETTING_CDMA_ALL     "name"","\
                                         NM_SETTING_CDMA_NUMBER","\
                                         NM_SETTING_CDMA_USERNAME","\
                                         NM_SETTING_CDMA_PASSWORD","\
-                                        NM_SETTING_CDMA_PASSWORD_FLAGS
+                                        NM_SETTING_CDMA_PASSWORD_FLAGS","\
+                                        NM_SETTING_CDMA_MTU
 
 /* Available fields for NM_SETTING_BLUETOOTH_SETTING_NAME */
 NmcOutputField nmc_fields_setting_bluetooth[] = {
@@ -693,6 +717,13 @@ NmcOutputField nmc_fields_setting_dcb[] = {
                                        NM_SETTING_DCB_PRIORITY_STRICT_BANDWIDTH","\
                                        NM_SETTING_DCB_PRIORITY_TRAFFIC_CLASS
 
+/* Available fields for NM_SETTING_DUMMY_SETTING_NAME */
+NmcOutputField nmc_fields_setting_dummy[] = {
+	SETTING_FIELD ("name"),                                /* 0 */
+	{NULL, NULL, 0, NULL, FALSE, FALSE, 0}
+};
+#define NMC_FIELDS_SETTING_DUMMY_ALL       "name"
+
 /* Available fields for NM_SETTING_TUN_SETTING_NAME */
 NmcOutputField nmc_fields_setting_tun[] = {
 	SETTING_FIELD ("name"),                                /* 0 */
@@ -869,10 +900,13 @@ bytes_to_string (GBytes *bytes)
 }
 
 static char *
-vlan_flags_to_string (guint32 flags)
+vlan_flags_to_string (guint32 flags, NmcPropertyGetType get_type)
 {
 	GString *flag_str;
 
+	if (get_type == NMC_PROPERTY_GET_PARSABLE)
+		return g_strdup_printf ("%u", flags);
+
 	if (flags == 0)
 		return g_strdup (_("0 (NONE)"));
 
@@ -1660,19 +1694,27 @@ DEFINE_GETTER (nmc_property_802_1X_get_eap, NM_SETTING_802_1X_EAP)
 DEFINE_GETTER (nmc_property_802_1X_get_identity, NM_SETTING_802_1X_IDENTITY)
 DEFINE_GETTER (nmc_property_802_1X_get_anonymous_identity, NM_SETTING_802_1X_ANONYMOUS_IDENTITY)
 DEFINE_GETTER (nmc_property_802_1X_get_pac_file, NM_SETTING_802_1X_PAC_FILE)
+DEFINE_GETTER (nmc_property_802_1X_get_ca_cert_password, NM_SETTING_802_1X_CA_CERT_PASSWORD)
+DEFINE_SECRET_FLAGS_GETTER (nmc_property_802_1X_get_ca_cert_password_flags, NM_SETTING_802_1X_CA_CERT_PASSWORD_FLAGS)
 DEFINE_GETTER (nmc_property_802_1X_get_ca_path, NM_SETTING_802_1X_CA_PATH)
 DEFINE_GETTER (nmc_property_802_1X_get_subject_match, NM_SETTING_802_1X_SUBJECT_MATCH)
 DEFINE_GETTER (nmc_property_802_1X_get_altsubject_matches, NM_SETTING_802_1X_ALTSUBJECT_MATCHES)
 DEFINE_GETTER (nmc_property_802_1X_get_domain_suffix_match, NM_SETTING_802_1X_DOMAIN_SUFFIX_MATCH)
+DEFINE_GETTER (nmc_property_802_1X_get_client_cert_password, NM_SETTING_802_1X_CLIENT_CERT_PASSWORD)
+DEFINE_SECRET_FLAGS_GETTER (nmc_property_802_1X_get_client_cert_password_flags, NM_SETTING_802_1X_CLIENT_CERT_PASSWORD_FLAGS)
 DEFINE_GETTER (nmc_property_802_1X_get_phase1_peapver, NM_SETTING_802_1X_PHASE1_PEAPVER)
 DEFINE_GETTER (nmc_property_802_1X_get_phase1_peaplabel, NM_SETTING_802_1X_PHASE1_PEAPLABEL)
 DEFINE_GETTER (nmc_property_802_1X_get_phase1_fast_provisioning, NM_SETTING_802_1X_PHASE1_FAST_PROVISIONING)
 DEFINE_GETTER (nmc_property_802_1X_get_phase2_auth, NM_SETTING_802_1X_PHASE2_AUTH)
 DEFINE_GETTER (nmc_property_802_1X_get_phase2_autheap, NM_SETTING_802_1X_PHASE2_AUTHEAP)
+DEFINE_GETTER (nmc_property_802_1X_get_phase2_ca_cert_password, NM_SETTING_802_1X_PHASE2_CA_CERT_PASSWORD)
+DEFINE_SECRET_FLAGS_GETTER (nmc_property_802_1X_get_phase2_ca_cert_password_flags, NM_SETTING_802_1X_PHASE2_CA_CERT_PASSWORD_FLAGS)
 DEFINE_GETTER (nmc_property_802_1X_get_phase2_ca_path, NM_SETTING_802_1X_PHASE2_CA_PATH)
 DEFINE_GETTER (nmc_property_802_1X_get_phase2_subject_match, NM_SETTING_802_1X_PHASE2_SUBJECT_MATCH)
 DEFINE_GETTER (nmc_property_802_1X_get_phase2_altsubject_matches, NM_SETTING_802_1X_PHASE2_ALTSUBJECT_MATCHES)
 DEFINE_GETTER (nmc_property_802_1X_get_phase2_domain_suffix_match, NM_SETTING_802_1X_PHASE2_DOMAIN_SUFFIX_MATCH)
+DEFINE_GETTER (nmc_property_802_1X_get_phase2_client_cert_password, NM_SETTING_802_1X_PHASE2_CLIENT_CERT_PASSWORD)
+DEFINE_SECRET_FLAGS_GETTER (nmc_property_802_1X_get_phase2_client_cert_password_flags, NM_SETTING_802_1X_PHASE2_CLIENT_CERT_PASSWORD_FLAGS)
 DEFINE_GETTER (nmc_property_802_1X_get_password, NM_SETTING_802_1X_PASSWORD)
 DEFINE_SECRET_FLAGS_GETTER (nmc_property_802_1X_get_password_flags, NM_SETTING_802_1X_PASSWORD_FLAGS)
 DEFINE_SECRET_FLAGS_GETTER (nmc_property_802_1X_get_password_raw_flags, NM_SETTING_802_1X_PASSWORD_RAW_FLAGS)
@@ -1683,6 +1725,7 @@ DEFINE_SECRET_FLAGS_GETTER (nmc_property_802_1X_get_phase2_private_key_password_
 DEFINE_GETTER (nmc_property_802_1X_get_pin, NM_SETTING_802_1X_PIN)
 DEFINE_SECRET_FLAGS_GETTER (nmc_property_802_1X_get_pin_flags, NM_SETTING_802_1X_PIN_FLAGS)
 DEFINE_GETTER (nmc_property_802_1X_get_system_ca_certs, NM_SETTING_802_1X_SYSTEM_CA_CERTS)
+DEFINE_GETTER (nmc_property_802_1X_get_auth_timeout, NM_SETTING_802_1X_AUTH_TIMEOUT)
 
 static char *
 nmc_property_802_1X_get_ca_cert (NMSetting *setting, NmcPropertyGetType get_type)
@@ -2158,6 +2201,58 @@ nmc_property_802_1X_describe_password_raw (NMSetting *setting, const char *prop)
 	         "          ab 4 55 0xa6 ea 3a 74 C2\n");
 }
 
+static char *
+nmc_property_802_1X_get_phase1_auth_flags (NMSetting *setting, NmcPropertyGetType get_type)
+{
+	NMSetting8021x *s_8021x = NM_SETTING_802_1X (setting);
+	NMSetting8021xAuthFlags flags;
+	char *tmp, *str;
+
+	flags = nm_setting_802_1x_get_phase1_auth_flags (s_8021x);
+	tmp = nm_utils_enum_to_str (nm_setting_802_1x_auth_flags_get_type (), flags);
+	if (get_type == NMC_PROPERTY_GET_PARSABLE)
+		str = g_strdup_printf ("%s", tmp && *tmp ? tmp : "none");
+	else
+		str = g_strdup_printf ("%d (%s)", flags, tmp && *tmp ? tmp : "none");
+	g_free (tmp);
+	return str;
+}
+
+static gboolean
+nmc_property_802_1X_set_phase1_auth_flags (NMSetting *setting, const char *prop,
+                                           const char *val, GError **error)
+{
+	NMSetting8021xAuthFlags flags;
+	gs_free char *err_token = NULL;
+	gboolean ret;
+	long int t;
+
+	if (nmc_string_to_int_base (val, 0, TRUE,
+	                            NM_SETTING_802_1X_AUTH_FLAGS_NONE,
+	                            NM_SETTING_802_1X_AUTH_FLAGS_ALL,
+	                            &t))
+		flags = (NMSetting8021xAuthFlags) t;
+	else {
+		ret = nm_utils_enum_from_str (nm_setting_802_1x_auth_flags_get_type (), val,
+		                              (int *) &flags, &err_token);
+
+		if (!ret) {
+			if (g_ascii_strcasecmp (err_token, "none") == 0)
+				flags = NM_SETTING_802_1X_AUTH_FLAGS_NONE;
+			else {
+				g_set_error (error, 1, 0, _("invalid option '%s', use a combination of [%s]"),
+				             err_token,
+				             nm_utils_enum_to_str (nm_setting_802_1x_auth_flags_get_type (),
+				                                   NM_SETTING_802_1X_AUTH_FLAGS_ALL));
+				return FALSE;
+			}
+		}
+	}
+
+	g_object_set (setting, prop, (guint) flags, NULL);
+	return TRUE;
+}
+
 
 /* --- NM_SETTING_ADSL_SETTING_NAME property functions --- */
 DEFINE_GETTER (nmc_property_adsl_get_username, NM_SETTING_ADSL_USERNAME)
@@ -2358,6 +2453,7 @@ DEFINE_GETTER (nmc_property_bridge_port_get_hairpin_mode, NM_SETTING_BRIDGE_PORT
 DEFINE_GETTER (nmc_property_cdma_get_number, NM_SETTING_CDMA_NUMBER)
 DEFINE_GETTER (nmc_property_cdma_get_username, NM_SETTING_CDMA_USERNAME)
 DEFINE_GETTER (nmc_property_cdma_get_password, NM_SETTING_CDMA_PASSWORD)
+DEFINE_GETTER (nmc_property_cdma_get_mtu, NM_SETTING_CDMA_MTU)
 
 DEFINE_SECRET_FLAGS_GETTER (nmc_property_cdma_get_password_flags, NM_SETTING_CDMA_PASSWORD_FLAGS)
 
@@ -2407,10 +2503,13 @@ nmc_property_connection_get_permissions (NMSetting *setting, NmcPropertyGetType
 		if (nm_setting_connection_get_permission (s_con, i, &perm_type, &perm_item, NULL))
 			g_string_append_printf (perm, "%s:%s,", perm_type, perm_item);
 	}
-	if (perm->len > 0)
+	if (perm->len > 0) {
 		g_string_truncate (perm, perm->len-1); /* remove trailing , */
+		return g_string_free (perm, FALSE);
+	}
 
-	return g_string_free (perm, FALSE);
+	/* No value from get_permission */
+	return g_string_free (perm, TRUE);
 }
 
 DEFINE_GETTER (nmc_property_connection_get_zone, NM_SETTING_CONNECTION_ZONE)
@@ -3194,6 +3293,7 @@ DEFINE_GETTER (nmc_property_gsm_get_home_only, NM_SETTING_GSM_HOME_ONLY)
 DEFINE_GETTER (nmc_property_gsm_get_device_id, NM_SETTING_GSM_DEVICE_ID)
 DEFINE_GETTER (nmc_property_gsm_get_sim_id, NM_SETTING_GSM_SIM_ID)
 DEFINE_GETTER (nmc_property_gsm_get_sim_operator_id, NM_SETTING_GSM_SIM_OPERATOR_ID)
+DEFINE_GETTER (nmc_property_gsm_get_mtu, NM_SETTING_GSM_MTU)
 
 static gboolean
 nmc_property_gsm_set_sim_operator_id (NMSetting *setting, const char *prop, const char *val, GError **error)
@@ -3376,29 +3476,6 @@ _parse_ip_address (int family, const char *address, GError **error)
 	return ipaddr;
 }
 
-static NMIPRoute *
-_parse_ip_route (int family, const char *route, GError **error)
-{
-	char *value = g_strdup (route);
-	char **routev;
-	guint len;
-	NMIPRoute *iproute = NULL;
-
-	routev = nmc_strsplit_set (g_strstrip (value), " \t", 0);
-	len = g_strv_length (routev);
-	if (len < 1 || len > 3) {
-		g_set_error (error, 1, 0, _("'%s' is not valid (the format is: ip[/prefix] [next-hop] [metric])"),
-		             route);
-		goto finish;
-	}
-	iproute = nmc_parse_and_build_route (family, routev[0], routev[1], len >= 2 ? routev[2] : NULL, error);
-
-finish:
-	g_free (value);
-	g_strfreev (routev);
-	return iproute;
-}
-
 DEFINE_GETTER (nmc_property_ipv4_get_method, NM_SETTING_IP_CONFIG_METHOD)
 DEFINE_GETTER (nmc_property_ipv4_get_dns, NM_SETTING_IP_CONFIG_DNS)
 DEFINE_GETTER (nmc_property_ipv4_get_dns_search, NM_SETTING_IP_CONFIG_DNS_SEARCH)
@@ -3442,8 +3519,21 @@ nmc_property_ipvx_get_routes (NMSetting *setting, NmcPropertyGetType get_type)
 
 	num_routes = nm_setting_ip_config_get_num_routes (s_ip);
 	for (i = 0; i < num_routes; i++) {
+		gs_free char *attr_str = NULL;
+		gs_strfreev char **attr_names = NULL;
+		gs_unref_hashtable GHashTable *hash = g_hash_table_new (g_str_hash, g_str_equal);
+		int j;
+
 		route = nm_setting_ip_config_get_route (s_ip, i);
 
+		attr_names = nm_ip_route_get_attribute_names (route);
+		for (j = 0; attr_names && attr_names[j]; j++) {
+			g_hash_table_insert (hash, attr_names[j],
+			                     nm_ip_route_get_attribute (route, attr_names[j]));
+		}
+
+		attr_str = nm_utils_format_variant_attributes (hash, ' ', '=');
+
 		if (get_type == NMC_PROPERTY_GET_PARSABLE) {
 			if (printable->len > 0)
 				g_string_append (printable, ", ");
@@ -3456,7 +3546,10 @@ nmc_property_ipvx_get_routes (NMSetting *setting, NmcPropertyGetType get_type)
 				g_string_append_printf (printable, " %s", nm_ip_route_get_next_hop (route));
 			if (nm_ip_route_get_metric (route) != -1)
 				g_string_append_printf (printable, " %u", (guint32) nm_ip_route_get_metric (route));
+			if (attr_str)
+				g_string_append_printf (printable, " %s", attr_str);
 		} else {
+
 			if (printable->len > 0)
 				g_string_append (printable, "; ");
 
@@ -3473,6 +3566,8 @@ nmc_property_ipvx_get_routes (NMSetting *setting, NmcPropertyGetType get_type)
 
 			if (nm_ip_route_get_metric (route) != -1)
 				g_string_append_printf (printable, ", mt = %u", (guint32) nm_ip_route_get_metric (route));
+			if (attr_str)
+				g_string_append_printf (printable, " %s", attr_str);
 
 			g_string_append (printable, " }");
 		}
@@ -3533,7 +3628,7 @@ static gboolean
 nmc_property_ipv4_set_method (NMSetting *setting, const char *prop, const char *val, GError **error)
 {
 	/* Silently accept "static" and convert to "manual" */
-	if (val && strlen (val) > 1 && matches (val, "static") == 0)
+	if (val && strlen (val) > 1 && matches (val, "static"))
 		val = NM_SETTING_IP4_CONFIG_METHOD_MANUAL;
 
 	return check_and_set_string (setting, prop, val, ipv4_valid_methods, error);
@@ -3764,7 +3859,7 @@ nmc_property_ipv4_set_gateway (NMSetting *setting, const char *prop, const char
 static NMIPRoute *
 _parse_ipv4_route (const char *route, GError **error)
 {
-	return _parse_ip_route (AF_INET, route, error);
+	return nmc_parse_and_build_route (AF_INET, route, error);
 }
 
 static gboolean
@@ -3871,7 +3966,7 @@ static gboolean
 nmc_property_ipv6_set_method (NMSetting *setting, const char *prop, const char *val, GError **error)
 {
 	/* Silently accept "static" and convert to "manual" */
-	if (val && strlen (val) > 1 && matches (val, "static") == 0)
+	if (val && strlen (val) > 1 && matches (val, "static"))
 		val = NM_SETTING_IP6_CONFIG_METHOD_MANUAL;
 
 	return check_and_set_string (setting, prop, val, ipv6_valid_methods, error);
@@ -4107,7 +4202,7 @@ nmc_property_ipv6_set_gateway (NMSetting *setting, const char *prop, const char
 static NMIPRoute *
 _parse_ipv6_route (const char *route, GError **error)
 {
-	return _parse_ip_route (AF_INET6, route, error);
+	return nmc_parse_and_build_route (AF_INET6, route, error);
 }
 
 static gboolean
@@ -4635,7 +4730,7 @@ static char *
 nmc_property_vlan_get_flags (NMSetting *setting, NmcPropertyGetType get_type)
 {
 	NMSettingVlan *s_vlan = NM_SETTING_VLAN (setting);
-	return vlan_flags_to_string (nm_setting_vlan_get_flags (s_vlan));
+	return vlan_flags_to_string (nm_setting_vlan_get_flags (s_vlan), get_type);
 }
 
 static char *
@@ -5726,7 +5821,7 @@ get_answer (const char *prop, const char *value)
 	else
 		question = g_strdup_printf (_("Do you also want to clear '%s'? [yes]: "), prop);
 	tmp_str = nmc_get_user_input (question);
-	if (!tmp_str || matches (tmp_str, "yes") == 0)
+	if (!tmp_str || matches (tmp_str, "yes"))
 		answer = TRUE;
 	g_free (tmp_str);
 	g_free (question);
@@ -5922,7 +6017,7 @@ connection_master_changed_cb (GObject *object, GParamSpec *pspec, gpointer user_
 			g_print (_("Warning: setting %s.%s requires removing ipv4 and ipv6 settings\n"),
 			         nm_setting_get_name (NM_SETTING (s_con)), g_param_spec_get_name (pspec));
 			tmp_str = nmc_get_user_input (_("Do you want to remove them? [yes] "));
-			if (!tmp_str || matches (tmp_str, "yes") == 0) {
+			if (!tmp_str || matches (tmp_str, "yes")) {
 				if (s_ipv4)
 					nm_connection_remove_setting (connection, G_OBJECT_TYPE (s_ipv4));
 				if (s_ipv6)
@@ -6129,6 +6224,20 @@ nmc_properties_init (void)
 	                    nmc_property_802_1X_describe_ca_cert,
 	                    NULL,
 	                    NULL);
+	nmc_add_prop_funcs (GLUE (802_1X, CA_CERT_PASSWORD),
+	                    nmc_property_802_1X_get_ca_cert_password,
+	                    nmc_property_set_string,
+	                    NULL,
+	                    NULL,
+	                    NULL,
+	                    NULL);
+	nmc_add_prop_funcs (GLUE (802_1X, CA_CERT_PASSWORD_FLAGS),
+	                    nmc_property_802_1X_get_ca_cert_password_flags,
+	                    nmc_property_set_secret_flags,
+	                    NULL,
+	                    NULL,
+	                    NULL,
+	                    NULL);
 	nmc_add_prop_funcs (GLUE (802_1X, CA_PATH),
 	                    nmc_property_802_1X_get_ca_path,
                             nmc_property_set_string,
@@ -6164,6 +6273,20 @@ nmc_properties_init (void)
 	                    nmc_property_802_1X_describe_client_cert,
 	                    NULL,
 	                    NULL);
+	nmc_add_prop_funcs (GLUE (802_1X, CLIENT_CERT_PASSWORD),
+	                    nmc_property_802_1X_get_client_cert_password,
+	                    nmc_property_set_string,
+	                    NULL,
+	                    NULL,
+	                    NULL,
+	                    NULL);
+	nmc_add_prop_funcs (GLUE (802_1X, CLIENT_CERT_PASSWORD_FLAGS),
+	                    nmc_property_802_1X_get_client_cert_password_flags,
+	                    nmc_property_set_secret_flags,
+	                    NULL,
+	                    NULL,
+	                    NULL,
+	                    NULL);
 	nmc_add_prop_funcs (GLUE (802_1X, PHASE1_PEAPVER),
 	                    nmc_property_802_1X_get_phase1_peapver,
 	                    nmc_property_802_1X_set_phase1_peapver,
@@ -6185,6 +6308,13 @@ nmc_properties_init (void)
 	                    NULL,
 	                    nmc_property_802_1X_allowed_phase1_fast_provisioning,
 	                    NULL);
+	nmc_add_prop_funcs (GLUE (802_1X, PHASE1_AUTH_FLAGS),
+	                    nmc_property_802_1X_get_phase1_auth_flags,
+	                    nmc_property_802_1X_set_phase1_auth_flags,
+	                    NULL,
+	                    NULL,
+	                    NULL,
+	                    NULL);
 	nmc_add_prop_funcs (GLUE (802_1X, PHASE2_AUTH),
 	                    nmc_property_802_1X_get_phase2_auth,
 	                    nmc_property_802_1X_set_phase2_auth,
@@ -6206,6 +6336,20 @@ nmc_properties_init (void)
 	                    nmc_property_802_1X_describe_phase2_ca_cert,
 	                    NULL,
 	                    NULL);
+	nmc_add_prop_funcs (GLUE (802_1X, PHASE2_CA_CERT_PASSWORD),
+	                    nmc_property_802_1X_get_phase2_ca_cert_password,
+	                    nmc_property_set_string,
+	                    NULL,
+	                    NULL,
+	                    NULL,
+	                    NULL);
+	nmc_add_prop_funcs (GLUE (802_1X, PHASE2_CA_CERT_PASSWORD_FLAGS),
+	                    nmc_property_802_1X_get_phase2_ca_cert_password_flags,
+	                    nmc_property_set_secret_flags,
+	                    NULL,
+	                    NULL,
+	                    NULL,
+	                    NULL);
 	nmc_add_prop_funcs (GLUE (802_1X, PHASE2_CA_PATH),
 	                    nmc_property_802_1X_get_phase2_ca_path,
 	                    nmc_property_set_string,
@@ -6241,6 +6385,20 @@ nmc_properties_init (void)
 	                    nmc_property_802_1X_describe_phase2_client_cert,
 	                    NULL,
 	                    NULL);
+	nmc_add_prop_funcs (GLUE (802_1X, PHASE2_CLIENT_CERT_PASSWORD),
+	                    nmc_property_802_1X_get_phase2_client_cert_password,
+	                    nmc_property_set_string,
+	                    NULL,
+	                    NULL,
+	                    NULL,
+	                    NULL);
+	nmc_add_prop_funcs (GLUE (802_1X, PHASE2_CLIENT_CERT_PASSWORD_FLAGS),
+	                    nmc_property_802_1X_get_phase2_client_cert_password_flags,
+	                    nmc_property_set_secret_flags,
+	                    NULL,
+	                    NULL,
+	                    NULL,
+	                    NULL);
 	nmc_add_prop_funcs (GLUE (802_1X, PASSWORD),
 	                    nmc_property_802_1X_get_password,
 	                    nmc_property_set_string,
@@ -6332,6 +6490,13 @@ nmc_properties_init (void)
 	                    NULL,
 	                    NULL,
 	                    NULL);
+	nmc_add_prop_funcs (GLUE (802_1X, AUTH_TIMEOUT),
+	                    nmc_property_802_1X_get_auth_timeout,
+	                    nmc_property_set_int,
+	                    NULL,
+	                    NULL,
+	                    NULL,
+	                    NULL);
 
 	/* Add editable properties for NM_SETTING_ADSL_SETTING_NAME */
 	nmc_add_prop_funcs (GLUE (ADSL, USERNAME),
@@ -6520,6 +6685,13 @@ nmc_properties_init (void)
 	                    NULL,
 	                    NULL,
 	                    NULL);
+	nmc_add_prop_funcs (GLUE (CDMA, MTU),
+	                    nmc_property_cdma_get_mtu,
+	                    nmc_property_set_uint,
+	                    NULL,
+	                    NULL,
+	                    NULL,
+	                    NULL);
 
 	/* Add editable properties for NM_SETTING_CONNECTION_SETTING_NAME */
 	nmc_add_prop_funcs (GLUE (CONNECTION, ID),
@@ -6848,6 +7020,13 @@ nmc_properties_init (void)
 	                    NULL,
 	                    NULL,
 	                    NULL);
+	nmc_add_prop_funcs (GLUE (GSM, MTU),
+	                    nmc_property_gsm_get_mtu,
+	                    nmc_property_set_uint,
+	                    NULL,
+	                    NULL,
+	                    NULL,
+	                    NULL);
 
 	/* Add editable properties for NM_SETTING_INFINIBAND_SETTING_NAME */
 	nmc_add_prop_funcs (GLUE (INFINIBAND, MAC_ADDRESS),
@@ -8471,11 +8650,14 @@ nmc_property_set_gvalue (NMSetting *setting, const char *prop, GValue *value)
 
 /*----------------------------------------------------------------------------*/
 
-#define GET_SECRET(show, setting, func) \
-	(show ? func (setting, NMC_PROPERTY_GET_PRETTY) : g_strdup (_("<hidden>")))
+#define GET_SECRET(show, setting, func, type) \
+	(show ? func (setting, type) : g_strdup (_("<hidden>")))
 
 static gboolean
-setting_connection_details (NMSetting *setting, NmCli *nmc,  const char *one_prop, gboolean secrets)
+setting_connection_details (NMSetting *setting, NmCli *nmc,
+                            const char *one_prop,
+                            gboolean secrets,
+                            NmcPropertyGetType type)
 {
 	NMSettingConnection *s_con = NM_SETTING_CONNECTION (setting);
 	NmcOutputField *tmpl, *arr;
@@ -8492,25 +8674,25 @@ setting_connection_details (NMSetting *setting, NmCli *nmc,  const char *one_pro
 
 	arr = nmc_dup_fields_array (tmpl, tmpl_len, NMC_OF_FLAG_SECTION_PREFIX);
 	set_val_str (arr, 0, g_strdup (nm_setting_get_name (setting)));
-	set_val_str (arr, 1, nmc_property_connection_get_id (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 2, nmc_property_connection_get_uuid (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 3, nmc_property_connection_get_stable_id (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 4, nmc_property_connection_get_interface_name (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 5, nmc_property_connection_get_type (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 6, nmc_property_connection_get_autoconnect (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 7, nmc_property_connection_get_autoconnect_priority (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 8, nmc_property_connection_get_autoconnect_retries (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 9, nmc_property_connection_get_timestamp (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 10, nmc_property_connection_get_read_only (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 11, nmc_property_connection_get_permissions (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 12, nmc_property_connection_get_zone (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 13, nmc_property_connection_get_master (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 14, nmc_property_connection_get_slave_type (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 15, nmc_property_connection_get_autoconnect_slaves (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 16, nmc_property_connection_get_secondaries (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 17, nmc_property_connection_get_gateway_ping_timeout (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 18, nmc_property_connection_get_metered (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 19, nmc_property_connection_get_lldp (setting, NMC_PROPERTY_GET_PRETTY));
+	set_val_str (arr, 1, nmc_property_connection_get_id (setting, type));
+	set_val_str (arr, 2, nmc_property_connection_get_uuid (setting, type));
+	set_val_str (arr, 3, nmc_property_connection_get_stable_id (setting, type));
+	set_val_str (arr, 4, nmc_property_connection_get_interface_name (setting, type));
+	set_val_str (arr, 5, nmc_property_connection_get_type (setting, type));
+	set_val_str (arr, 6, nmc_property_connection_get_autoconnect (setting, type));
+	set_val_str (arr, 7, nmc_property_connection_get_autoconnect_priority (setting, type));
+	set_val_str (arr, 8, nmc_property_connection_get_autoconnect_retries (setting, type));
+	set_val_str (arr, 9, nmc_property_connection_get_timestamp (setting, type));
+	set_val_str (arr, 10, nmc_property_connection_get_read_only (setting, type));
+	set_val_str (arr, 11, nmc_property_connection_get_permissions (setting, type));
+	set_val_str (arr, 12, nmc_property_connection_get_zone (setting, type));
+	set_val_str (arr, 13, nmc_property_connection_get_master (setting, type));
+	set_val_str (arr, 14, nmc_property_connection_get_slave_type (setting, type));
+	set_val_str (arr, 15, nmc_property_connection_get_autoconnect_slaves (setting, type));
+	set_val_str (arr, 16, nmc_property_connection_get_secondaries (setting, type));
+	set_val_str (arr, 17, nmc_property_connection_get_gateway_ping_timeout (setting, type));
+	set_val_str (arr, 18, nmc_property_connection_get_metered (setting, type));
+	set_val_str (arr, 19, nmc_property_connection_get_lldp (setting, type));
 	g_ptr_array_add (nmc->output_data, arr);
 
 	print_data (nmc);  /* Print all data */
@@ -8519,7 +8701,11 @@ setting_connection_details (NMSetting *setting, NmCli *nmc,  const char *one_pro
 }
 
 static gboolean
-setting_wired_details (NMSetting *setting, NmCli *nmc,  const char *one_prop, gboolean secrets)
+setting_wired_details (NMSetting *setting,
+                       NmCli *nmc,
+                       const char *one_prop,
+                       gboolean secrets,
+                       NmcPropertyGetType type)
 {
 	NMSettingWired *s_wired = NM_SETTING_WIRED (setting);
 	NmcOutputField *tmpl, *arr;
@@ -8536,20 +8722,20 @@ setting_wired_details (NMSetting *setting, NmCli *nmc,  const char *one_prop, gb
 
 	arr = nmc_dup_fields_array (tmpl, tmpl_len, NMC_OF_FLAG_SECTION_PREFIX);
 	set_val_str (arr, 0, g_strdup (nm_setting_get_name (setting)));
-	set_val_str (arr, 1, nmc_property_wired_get_port (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 2, nmc_property_wired_get_speed (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 3, nmc_property_wired_get_duplex (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 4, nmc_property_wired_get_auto_negotiate (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 5, nmc_property_wired_get_mac_address (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 6, nmc_property_wired_get_cloned_mac_address (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 7, nmc_property_wired_get_generate_mac_address_mask (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 8, nmc_property_wired_get_mac_address_blacklist (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 9, nmc_property_wired_get_mtu (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 10, nmc_property_wired_get_s390_subchannels (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 11, nmc_property_wired_get_s390_nettype (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 12, nmc_property_wired_get_s390_options (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 13, nmc_property_wired_get_wake_on_lan (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 14, nmc_property_wired_get_wake_on_lan_password (setting, NMC_PROPERTY_GET_PRETTY));
+	set_val_str (arr, 1, nmc_property_wired_get_port (setting, type));
+	set_val_str (arr, 2, nmc_property_wired_get_speed (setting, type));
+	set_val_str (arr, 3, nmc_property_wired_get_duplex (setting, type));
+	set_val_str (arr, 4, nmc_property_wired_get_auto_negotiate (setting, type));
+	set_val_str (arr, 5, nmc_property_wired_get_mac_address (setting, type));
+	set_val_str (arr, 6, nmc_property_wired_get_cloned_mac_address (setting, type));
+	set_val_str (arr, 7, nmc_property_wired_get_generate_mac_address_mask (setting, type));
+	set_val_str (arr, 8, nmc_property_wired_get_mac_address_blacklist (setting, type));
+	set_val_str (arr, 9, nmc_property_wired_get_mtu (setting, type));
+	set_val_str (arr, 10, nmc_property_wired_get_s390_subchannels (setting, type));
+	set_val_str (arr, 11, nmc_property_wired_get_s390_nettype (setting, type));
+	set_val_str (arr, 12, nmc_property_wired_get_s390_options (setting, type));
+	set_val_str (arr, 13, nmc_property_wired_get_wake_on_lan (setting, type));
+	set_val_str (arr, 14, nmc_property_wired_get_wake_on_lan_password (setting, type));
 	g_ptr_array_add (nmc->output_data, arr);
 
 	print_data (nmc);  /* Print all data */
@@ -8558,7 +8744,11 @@ setting_wired_details (NMSetting *setting, NmCli *nmc,  const char *one_prop, gb
 }
 
 static gboolean
-setting_802_1X_details (NMSetting *setting, NmCli *nmc,  const char *one_prop, gboolean secrets)
+setting_802_1X_details (NMSetting *setting,
+                        NmCli *nmc,
+                        const char *one_prop,
+                        gboolean secrets,
+                        NmcPropertyGetType type)
 {
 	NMSetting8021x *s_8021x = NM_SETTING_802_1X (setting);
 	NmcOutputField *tmpl, *arr;
@@ -8575,40 +8765,50 @@ setting_802_1X_details (NMSetting *setting, NmCli *nmc,  const char *one_prop, g
 
 	arr = nmc_dup_fields_array (tmpl, tmpl_len, NMC_OF_FLAG_SECTION_PREFIX);
 	set_val_str (arr, 0, g_strdup (nm_setting_get_name (setting)));
-	set_val_str (arr, 1, nmc_property_802_1X_get_eap (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 2, nmc_property_802_1X_get_identity (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 3, nmc_property_802_1X_get_anonymous_identity (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 4, nmc_property_802_1X_get_pac_file (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 5, nmc_property_802_1X_get_ca_cert (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 6, nmc_property_802_1X_get_ca_path (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 7, nmc_property_802_1X_get_subject_match (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 8, nmc_property_802_1X_get_altsubject_matches (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 9, nmc_property_802_1X_get_domain_suffix_match (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 10, nmc_property_802_1X_get_client_cert (setting, NMC_PROPERTY_GET_PRETTY, secrets));
-	set_val_str (arr, 11, nmc_property_802_1X_get_phase1_peapver (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 12, nmc_property_802_1X_get_phase1_peaplabel (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 13, nmc_property_802_1X_get_phase1_fast_provisioning (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 14, nmc_property_802_1X_get_phase2_auth (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 15, nmc_property_802_1X_get_phase2_autheap (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 16, nmc_property_802_1X_get_phase2_ca_cert (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 17, nmc_property_802_1X_get_phase2_ca_path (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 18, nmc_property_802_1X_get_phase2_subject_match (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 19, nmc_property_802_1X_get_phase2_altsubject_matches (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 20, nmc_property_802_1X_get_phase2_domain_suffix_match (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 21, nmc_property_802_1X_get_phase2_client_cert (setting, NMC_PROPERTY_GET_PRETTY, secrets));
-	set_val_str (arr, 22, GET_SECRET (secrets, setting, nmc_property_802_1X_get_password));
-	set_val_str (arr, 23, nmc_property_802_1X_get_password_flags (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 24, GET_SECRET (secrets, setting, nmc_property_802_1X_get_password_raw));
-	set_val_str (arr, 25, nmc_property_802_1X_get_password_raw_flags (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 26, nmc_property_802_1X_get_private_key (setting, NMC_PROPERTY_GET_PRETTY, secrets));
-	set_val_str (arr, 27, GET_SECRET (secrets, setting, nmc_property_802_1X_get_private_key_password));
-	set_val_str (arr, 28, nmc_property_802_1X_get_private_key_password_flags (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 29, nmc_property_802_1X_get_phase2_private_key (setting, NMC_PROPERTY_GET_PRETTY, secrets));
-	set_val_str (arr, 30, GET_SECRET (secrets, setting, nmc_property_802_1X_get_phase2_private_key_password));
-	set_val_str (arr, 31, nmc_property_802_1X_get_phase2_private_key_password_flags (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 32, GET_SECRET (secrets, setting, nmc_property_802_1X_get_pin));
-	set_val_str (arr, 33, nmc_property_802_1X_get_pin_flags (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 34, nmc_property_802_1X_get_system_ca_certs (setting, NMC_PROPERTY_GET_PRETTY));
+	set_val_str (arr, 1, nmc_property_802_1X_get_eap (setting, type));
+	set_val_str (arr, 2, nmc_property_802_1X_get_identity (setting, type));
+	set_val_str (arr, 3, nmc_property_802_1X_get_anonymous_identity (setting, type));
+	set_val_str (arr, 4, nmc_property_802_1X_get_pac_file (setting, type));
+	set_val_str (arr, 5, nmc_property_802_1X_get_ca_cert (setting, type));
+	set_val_str (arr, 6, GET_SECRET (secrets, setting, nmc_property_802_1X_get_ca_cert_password, type));
+	set_val_str (arr, 7, nmc_property_802_1X_get_ca_cert_password_flags (setting, type));
+	set_val_str (arr, 8, nmc_property_802_1X_get_ca_path (setting, type));
+	set_val_str (arr, 9, nmc_property_802_1X_get_subject_match (setting, type));
+	set_val_str (arr, 10, nmc_property_802_1X_get_altsubject_matches (setting, type));
+	set_val_str (arr, 11, nmc_property_802_1X_get_domain_suffix_match (setting, type));
+	set_val_str (arr, 12, nmc_property_802_1X_get_client_cert (setting, type, secrets));
+	set_val_str (arr, 13, GET_SECRET (secrets, setting, nmc_property_802_1X_get_client_cert_password, type));
+	set_val_str (arr, 14, nmc_property_802_1X_get_client_cert_password_flags (setting, type));
+	set_val_str (arr, 15, nmc_property_802_1X_get_phase1_peapver (setting, type));
+	set_val_str (arr, 16, nmc_property_802_1X_get_phase1_peaplabel (setting, type));
+	set_val_str (arr, 17, nmc_property_802_1X_get_phase1_fast_provisioning (setting, type));
+	set_val_str (arr, 18, nmc_property_802_1X_get_phase1_auth_flags (setting, type));
+	set_val_str (arr, 19, nmc_property_802_1X_get_phase2_auth (setting, type));
+	set_val_str (arr, 20, nmc_property_802_1X_get_phase2_autheap (setting, type));
+	set_val_str (arr, 21, nmc_property_802_1X_get_phase2_ca_cert (setting, type));
+	set_val_str (arr, 22, GET_SECRET (secrets, setting, nmc_property_802_1X_get_phase2_ca_cert_password, type));
+	set_val_str (arr, 23, nmc_property_802_1X_get_phase2_ca_cert_password_flags (setting, type));
+	set_val_str (arr, 24, nmc_property_802_1X_get_phase2_ca_path (setting, type));
+	set_val_str (arr, 25, nmc_property_802_1X_get_phase2_subject_match (setting, type));
+	set_val_str (arr, 26, nmc_property_802_1X_get_phase2_altsubject_matches (setting, type));
+	set_val_str (arr, 27, nmc_property_802_1X_get_phase2_domain_suffix_match (setting, type));
+	set_val_str (arr, 28, nmc_property_802_1X_get_phase2_client_cert (setting, type, secrets));
+	set_val_str (arr, 29, GET_SECRET (secrets, setting, nmc_property_802_1X_get_phase2_client_cert_password, type));
+	set_val_str (arr, 30, nmc_property_802_1X_get_phase2_client_cert_password_flags (setting, type));
+	set_val_str (arr, 31, GET_SECRET (secrets, setting, nmc_property_802_1X_get_password, type));
+	set_val_str (arr, 32, nmc_property_802_1X_get_password_flags (setting, type));
+	set_val_str (arr, 33, GET_SECRET (secrets, setting, nmc_property_802_1X_get_password_raw, type));
+	set_val_str (arr, 34, nmc_property_802_1X_get_password_raw_flags (setting, type));
+	set_val_str (arr, 35, nmc_property_802_1X_get_private_key (setting, type, secrets));
+	set_val_str (arr, 36, GET_SECRET (secrets, setting, nmc_property_802_1X_get_private_key_password, type));
+	set_val_str (arr, 37, nmc_property_802_1X_get_private_key_password_flags (setting, type));
+	set_val_str (arr, 38, nmc_property_802_1X_get_phase2_private_key (setting, type, secrets));
+	set_val_str (arr, 39, GET_SECRET (secrets, setting, nmc_property_802_1X_get_phase2_private_key_password, type));
+	set_val_str (arr, 40, nmc_property_802_1X_get_phase2_private_key_password_flags (setting, type));
+	set_val_str (arr, 41, GET_SECRET (secrets, setting, nmc_property_802_1X_get_pin, type));
+	set_val_str (arr, 42, nmc_property_802_1X_get_pin_flags (setting, type));
+	set_val_str (arr, 43, nmc_property_802_1X_get_system_ca_certs (setting, type));
+	set_val_str (arr, 44, nmc_property_802_1X_get_auth_timeout (setting, type));
 	g_ptr_array_add (nmc->output_data, arr);
 
 	print_data (nmc);  /* Print all data */
@@ -8617,7 +8817,11 @@ setting_802_1X_details (NMSetting *setting, NmCli *nmc,  const char *one_prop, g
 }
 
 static gboolean
-setting_wireless_details (NMSetting *setting, NmCli *nmc,  const char *one_prop, gboolean secrets)
+setting_wireless_details (NMSetting *setting,
+                          NmCli *nmc,
+                          const char *one_prop,
+                          gboolean secrets,
+                          NmcPropertyGetType type)
 {
 	NMSettingWireless *s_wireless = NM_SETTING_WIRELESS (setting);
 	NmcOutputField *tmpl, *arr;
@@ -8634,22 +8838,22 @@ setting_wireless_details (NMSetting *setting, NmCli *nmc,  const char *one_prop,
 
 	arr = nmc_dup_fields_array (tmpl, tmpl_len, NMC_OF_FLAG_SECTION_PREFIX);
 	set_val_str (arr, 0, g_strdup (nm_setting_get_name (setting)));
-	set_val_str (arr, 1, nmc_property_wireless_get_ssid (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 2, nmc_property_wireless_get_mode (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 3, nmc_property_wireless_get_band (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 4, nmc_property_wireless_get_channel (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 5, nmc_property_wireless_get_bssid (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 6, nmc_property_wireless_get_rate (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 7, nmc_property_wireless_get_tx_power (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 8, nmc_property_wireless_get_mac_address (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 9, nmc_property_wireless_get_cloned_mac_address (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 10, nmc_property_wireless_get_generate_mac_address_mask (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 11, nmc_property_wireless_get_mac_address_blacklist (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 12, nmc_property_wireless_get_mac_address_randomization (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 13, nmc_property_wireless_get_mtu (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 14, nmc_property_wireless_get_seen_bssids (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 15, nmc_property_wireless_get_hidden (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 16, nmc_property_wireless_get_powersave (setting, NMC_PROPERTY_GET_PRETTY));
+	set_val_str (arr, 1, nmc_property_wireless_get_ssid (setting, type));
+	set_val_str (arr, 2, nmc_property_wireless_get_mode (setting, type));
+	set_val_str (arr, 3, nmc_property_wireless_get_band (setting, type));
+	set_val_str (arr, 4, nmc_property_wireless_get_channel (setting, type));
+	set_val_str (arr, 5, nmc_property_wireless_get_bssid (setting, type));
+	set_val_str (arr, 6, nmc_property_wireless_get_rate (setting, type));
+	set_val_str (arr, 7, nmc_property_wireless_get_tx_power (setting, type));
+	set_val_str (arr, 8, nmc_property_wireless_get_mac_address (setting, type));
+	set_val_str (arr, 9, nmc_property_wireless_get_cloned_mac_address (setting, type));
+	set_val_str (arr, 10, nmc_property_wireless_get_generate_mac_address_mask (setting, type));
+	set_val_str (arr, 11, nmc_property_wireless_get_mac_address_blacklist (setting, type));
+	set_val_str (arr, 12, nmc_property_wireless_get_mac_address_randomization (setting, type));
+	set_val_str (arr, 13, nmc_property_wireless_get_mtu (setting, type));
+	set_val_str (arr, 14, nmc_property_wireless_get_seen_bssids (setting, type));
+	set_val_str (arr, 15, nmc_property_wireless_get_hidden (setting, type));
+	set_val_str (arr, 16, nmc_property_wireless_get_powersave (setting, type));
 	g_ptr_array_add (nmc->output_data, arr);
 
 	print_data (nmc);  /* Print all data */
@@ -8658,7 +8862,11 @@ setting_wireless_details (NMSetting *setting, NmCli *nmc,  const char *one_prop,
 }
 
 static gboolean
-setting_wireless_security_details (NMSetting *setting, NmCli *nmc, const char *one_prop, gboolean secrets)
+setting_wireless_security_details (NMSetting *setting,
+                                   NmCli *nmc,
+                                   const char *one_prop,
+                                   gboolean secrets,
+                                   NmcPropertyGetType type)
 {
 	NMSettingWirelessSecurity *s_wireless_sec = NM_SETTING_WIRELESS_SECURITY (setting);
 	NmcOutputField *tmpl, *arr;
@@ -8675,23 +8883,23 @@ setting_wireless_security_details (NMSetting *setting, NmCli *nmc, const char *o
 
 	arr = nmc_dup_fields_array (tmpl, tmpl_len, NMC_OF_FLAG_SECTION_PREFIX);
 	set_val_str (arr, 0, g_strdup (nm_setting_get_name (setting)));
-	set_val_str (arr, 1, nmc_property_wifi_sec_get_key_mgmt (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 2, nmc_property_wifi_sec_get_wep_tx_keyidx (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 3, nmc_property_wifi_sec_get_auth_alg (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 4, nmc_property_wifi_sec_get_proto (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 5, nmc_property_wifi_sec_get_pairwise (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 6, nmc_property_wifi_sec_get_group (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 7, nmc_property_wifi_sec_get_leap_username (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 8, GET_SECRET (secrets, setting, nmc_property_wifi_sec_get_wep_key0));
-	set_val_str (arr, 9, GET_SECRET (secrets, setting, nmc_property_wifi_sec_get_wep_key1));
-	set_val_str (arr, 10, GET_SECRET (secrets, setting, nmc_property_wifi_sec_get_wep_key2));
-	set_val_str (arr, 11, GET_SECRET (secrets, setting, nmc_property_wifi_sec_get_wep_key3));
-	set_val_str (arr, 12, nmc_property_wifi_sec_get_wep_key_flags (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 13, nmc_property_wifi_sec_get_wep_key_type (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 14, GET_SECRET (secrets, setting, nmc_property_wifi_sec_get_psk));
-	set_val_str (arr, 15, nmc_property_wifi_sec_get_psk_flags (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 16, GET_SECRET (secrets, setting, nmc_property_wifi_sec_get_leap_password));
-	set_val_str (arr, 17, nmc_property_wifi_sec_get_leap_password_flags (setting, NMC_PROPERTY_GET_PRETTY));
+	set_val_str (arr, 1, nmc_property_wifi_sec_get_key_mgmt (setting, type));
+	set_val_str (arr, 2, nmc_property_wifi_sec_get_wep_tx_keyidx (setting, type));
+	set_val_str (arr, 3, nmc_property_wifi_sec_get_auth_alg (setting, type));
+	set_val_str (arr, 4, nmc_property_wifi_sec_get_proto (setting, type));
+	set_val_str (arr, 5, nmc_property_wifi_sec_get_pairwise (setting, type));
+	set_val_str (arr, 6, nmc_property_wifi_sec_get_group (setting, type));
+	set_val_str (arr, 7, nmc_property_wifi_sec_get_leap_username (setting, type));
+	set_val_str (arr, 8, GET_SECRET (secrets, setting, nmc_property_wifi_sec_get_wep_key0, type));
+	set_val_str (arr, 9, GET_SECRET (secrets, setting, nmc_property_wifi_sec_get_wep_key1, type));
+	set_val_str (arr, 10, GET_SECRET (secrets, setting, nmc_property_wifi_sec_get_wep_key2, type));
+	set_val_str (arr, 11, GET_SECRET (secrets, setting, nmc_property_wifi_sec_get_wep_key3, type));
+	set_val_str (arr, 12, nmc_property_wifi_sec_get_wep_key_flags (setting, type));
+	set_val_str (arr, 13, nmc_property_wifi_sec_get_wep_key_type (setting, type));
+	set_val_str (arr, 14, GET_SECRET (secrets, setting, nmc_property_wifi_sec_get_psk, type));
+	set_val_str (arr, 15, nmc_property_wifi_sec_get_psk_flags (setting, type));
+	set_val_str (arr, 16, GET_SECRET (secrets, setting, nmc_property_wifi_sec_get_leap_password, type));
+	set_val_str (arr, 17, nmc_property_wifi_sec_get_leap_password_flags (setting, type));
 	g_ptr_array_add (nmc->output_data, arr);
 
 	print_data (nmc);  /* Print all data */
@@ -8700,7 +8908,11 @@ setting_wireless_security_details (NMSetting *setting, NmCli *nmc, const char *o
 }
 
 static gboolean
-setting_ip4_config_details (NMSetting *setting, NmCli *nmc,  const char *one_prop, gboolean secrets)
+setting_ip4_config_details (NMSetting *setting,
+                            NmCli *nmc,
+                            const char *one_prop,
+                            gboolean secrets,
+                            NmcPropertyGetType type)
 {
 	NMSettingIPConfig *s_ip4 = NM_SETTING_IP_CONFIG (setting);
 	NmcOutputField *tmpl, *arr;
@@ -8717,25 +8929,25 @@ setting_ip4_config_details (NMSetting *setting, NmCli *nmc,  const char *one_pro
 
 	arr = nmc_dup_fields_array (tmpl, tmpl_len, NMC_OF_FLAG_SECTION_PREFIX);
 	set_val_str (arr, 0, g_strdup (nm_setting_get_name (setting)));
-	set_val_str (arr, 1, nmc_property_ipv4_get_method (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 2, nmc_property_ipv4_get_dns (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 3, nmc_property_ipv4_get_dns_search (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 4, nmc_property_ipv4_get_dns_options (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 5, nmc_property_ipv4_get_dns_priority (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 6, nmc_property_ip_get_addresses (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 7, nmc_property_ipv4_get_gateway (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 8, nmc_property_ipv4_get_routes (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 9, nmc_property_ipv4_get_route_metric (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 10, nmc_property_ipv4_get_ignore_auto_routes (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 11, nmc_property_ipv4_get_ignore_auto_dns (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 12, nmc_property_ipv4_get_dhcp_client_id (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 13, nmc_property_ipv4_get_dhcp_timeout (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 14, nmc_property_ipv4_get_dhcp_send_hostname (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 15, nmc_property_ipv4_get_dhcp_hostname (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 16, nmc_property_ipv4_get_dhcp_fqdn (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 17, nmc_property_ipv4_get_never_default (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 18, nmc_property_ipv4_get_may_fail (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 19, nmc_property_ipv4_get_dad_timeout (setting, NMC_PROPERTY_GET_PRETTY));
+	set_val_str (arr, 1, nmc_property_ipv4_get_method (setting, type));
+	set_val_str (arr, 2, nmc_property_ipv4_get_dns (setting, type));
+	set_val_str (arr, 3, nmc_property_ipv4_get_dns_search (setting, type));
+	set_val_str (arr, 4, nmc_property_ipv4_get_dns_options (setting, type));
+	set_val_str (arr, 5, nmc_property_ipv4_get_dns_priority (setting, type));
+	set_val_str (arr, 6, nmc_property_ip_get_addresses (setting, type));
+	set_val_str (arr, 7, nmc_property_ipv4_get_gateway (setting, type));
+	set_val_str (arr, 8, nmc_property_ipv4_get_routes (setting, type));
+	set_val_str (arr, 9, nmc_property_ipv4_get_route_metric (setting, type));
+	set_val_str (arr, 10, nmc_property_ipv4_get_ignore_auto_routes (setting, type));
+	set_val_str (arr, 11, nmc_property_ipv4_get_ignore_auto_dns (setting, type));
+	set_val_str (arr, 12, nmc_property_ipv4_get_dhcp_client_id (setting, type));
+	set_val_str (arr, 13, nmc_property_ipv4_get_dhcp_timeout (setting, type));
+	set_val_str (arr, 14, nmc_property_ipv4_get_dhcp_send_hostname (setting, type));
+	set_val_str (arr, 15, nmc_property_ipv4_get_dhcp_hostname (setting, type));
+	set_val_str (arr, 16, nmc_property_ipv4_get_dhcp_fqdn (setting, type));
+	set_val_str (arr, 17, nmc_property_ipv4_get_never_default (setting, type));
+	set_val_str (arr, 18, nmc_property_ipv4_get_may_fail (setting, type));
+	set_val_str (arr, 19, nmc_property_ipv4_get_dad_timeout (setting, type));
 	g_ptr_array_add (nmc->output_data, arr);
 
 	print_data (nmc);  /* Print all data */
@@ -8744,7 +8956,11 @@ setting_ip4_config_details (NMSetting *setting, NmCli *nmc,  const char *one_pro
 }
 
 static gboolean
-setting_ip6_config_details (NMSetting *setting, NmCli *nmc,  const char *one_prop, gboolean secrets)
+setting_ip6_config_details (NMSetting *setting,
+                            NmCli *nmc,
+                            const char *one_prop,
+                            gboolean secrets,
+                            NmcPropertyGetType type)
 {
 	NMSettingIPConfig *s_ip6 = NM_SETTING_IP_CONFIG (setting);
 	NmcOutputField *tmpl, *arr;
@@ -8761,24 +8977,24 @@ setting_ip6_config_details (NMSetting *setting, NmCli *nmc,  const char *one_pro
 
 	arr = nmc_dup_fields_array (tmpl, tmpl_len, NMC_OF_FLAG_SECTION_PREFIX);
 	set_val_str (arr, 0, g_strdup (nm_setting_get_name (setting)));
-	set_val_str (arr, 1, nmc_property_ipv6_get_method (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 2, nmc_property_ipv6_get_dns (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 3, nmc_property_ipv6_get_dns_search (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 4, nmc_property_ipv6_get_dns_options (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 5, nmc_property_ipv6_get_dns_priority (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 6, nmc_property_ip_get_addresses (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 7, nmc_property_ipv6_get_gateway (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 8, nmc_property_ipv6_get_routes (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 9, nmc_property_ipv6_get_route_metric (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 10, nmc_property_ipv6_get_ignore_auto_routes (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 11, nmc_property_ipv6_get_ignore_auto_dns (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 12, nmc_property_ipv6_get_never_default (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 13, nmc_property_ipv6_get_may_fail (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 14, nmc_property_ipv6_get_ip6_privacy (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 15, nmc_property_ipv6_get_addr_gen_mode (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 16, nmc_property_ipv6_get_dhcp_send_hostname (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 17, nmc_property_ipv6_get_dhcp_hostname (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 18, nmc_property_ipv6_get_token (setting, NMC_PROPERTY_GET_PRETTY));
+	set_val_str (arr, 1, nmc_property_ipv6_get_method (setting, type));
+	set_val_str (arr, 2, nmc_property_ipv6_get_dns (setting, type));
+	set_val_str (arr, 3, nmc_property_ipv6_get_dns_search (setting, type));
+	set_val_str (arr, 4, nmc_property_ipv6_get_dns_options (setting, type));
+	set_val_str (arr, 5, nmc_property_ipv6_get_dns_priority (setting, type));
+	set_val_str (arr, 6, nmc_property_ip_get_addresses (setting, type));
+	set_val_str (arr, 7, nmc_property_ipv6_get_gateway (setting, type));
+	set_val_str (arr, 8, nmc_property_ipv6_get_routes (setting, type));
+	set_val_str (arr, 9, nmc_property_ipv6_get_route_metric (setting, type));
+	set_val_str (arr, 10, nmc_property_ipv6_get_ignore_auto_routes (setting, type));
+	set_val_str (arr, 11, nmc_property_ipv6_get_ignore_auto_dns (setting, type));
+	set_val_str (arr, 12, nmc_property_ipv6_get_never_default (setting, type));
+	set_val_str (arr, 13, nmc_property_ipv6_get_may_fail (setting, type));
+	set_val_str (arr, 14, nmc_property_ipv6_get_ip6_privacy (setting, type));
+	set_val_str (arr, 15, nmc_property_ipv6_get_addr_gen_mode (setting, type));
+	set_val_str (arr, 16, nmc_property_ipv6_get_dhcp_send_hostname (setting, type));
+	set_val_str (arr, 17, nmc_property_ipv6_get_dhcp_hostname (setting, type));
+	set_val_str (arr, 18, nmc_property_ipv6_get_token (setting, type));
 	g_ptr_array_add (nmc->output_data, arr);
 
 	print_data (nmc);  /* Print all data */
@@ -8787,7 +9003,11 @@ setting_ip6_config_details (NMSetting *setting, NmCli *nmc,  const char *one_pro
 }
 
 static gboolean
-setting_serial_details (NMSetting *setting, NmCli *nmc,  const char *one_prop, gboolean secrets)
+setting_serial_details (NMSetting *setting,
+                        NmCli *nmc,
+                        const char *one_prop,
+                        gboolean secrets,
+                        NmcPropertyGetType type)
 {
 	NMSettingSerial *s_serial = NM_SETTING_SERIAL (setting);
 	NmcOutputField *tmpl, *arr;
@@ -8804,11 +9024,11 @@ setting_serial_details (NMSetting *setting, NmCli *nmc,  const char *one_prop, g
 
 	arr = nmc_dup_fields_array (tmpl, tmpl_len, NMC_OF_FLAG_SECTION_PREFIX);
 	set_val_str (arr, 0, g_strdup (nm_setting_get_name (setting)));
-	set_val_str (arr, 1, nmc_property_serial_get_baud (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 2, nmc_property_serial_get_bits (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 3, nmc_property_serial_get_parity (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 4, nmc_property_serial_get_stopbits (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 5, nmc_property_serial_get_send_delay (setting, NMC_PROPERTY_GET_PRETTY));
+	set_val_str (arr, 1, nmc_property_serial_get_baud (setting, type));
+	set_val_str (arr, 2, nmc_property_serial_get_bits (setting, type));
+	set_val_str (arr, 3, nmc_property_serial_get_parity (setting, type));
+	set_val_str (arr, 4, nmc_property_serial_get_stopbits (setting, type));
+	set_val_str (arr, 5, nmc_property_serial_get_send_delay (setting, type));
 	g_ptr_array_add (nmc->output_data, arr);
 
 	print_data (nmc);  /* Print all data */
@@ -8817,7 +9037,10 @@ setting_serial_details (NMSetting *setting, NmCli *nmc,  const char *one_prop, g
 }
 
 static gboolean
-setting_ppp_details (NMSetting *setting, NmCli *nmc,  const char *one_prop, gboolean secrets)
+setting_ppp_details (NMSetting *setting, NmCli *nmc,
+                     const char *one_prop,
+                     gboolean secrets,
+                     NmcPropertyGetType type)
 {
 	NMSettingPpp *s_ppp = NM_SETTING_PPP (setting);
 	NmcOutputField *tmpl, *arr;
@@ -8834,24 +9057,24 @@ setting_ppp_details (NMSetting *setting, NmCli *nmc,  const char *one_prop, gboo
 
 	arr = nmc_dup_fields_array (tmpl, tmpl_len, NMC_OF_FLAG_SECTION_PREFIX);
 	set_val_str (arr, 0, g_strdup (nm_setting_get_name (setting)));
-	set_val_str (arr, 1, nmc_property_ppp_get_noauth (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 2, nmc_property_ppp_get_refuse_eap (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 3, nmc_property_ppp_get_refuse_pap (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 4, nmc_property_ppp_get_refuse_chap (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 5, nmc_property_ppp_get_refuse_mschap (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 6, nmc_property_ppp_get_refuse_mschapv2 (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 7, nmc_property_ppp_get_nobsdcomp (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 8, nmc_property_ppp_get_nodeflate (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 9, nmc_property_ppp_get_no_vj_comp (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 10, nmc_property_ppp_get_require_mppe (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 11, nmc_property_ppp_get_require_mppe_128 (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 12, nmc_property_ppp_get_mppe_stateful (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 13, nmc_property_ppp_get_crtscts (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 14, nmc_property_ppp_get_baud (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 15, nmc_property_ppp_get_mru (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 16, nmc_property_ppp_get_mtu (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 17, nmc_property_ppp_get_lcp_echo_failure (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 18, nmc_property_ppp_get_lcp_echo_interval (setting, NMC_PROPERTY_GET_PRETTY));
+	set_val_str (arr, 1, nmc_property_ppp_get_noauth (setting, type));
+	set_val_str (arr, 2, nmc_property_ppp_get_refuse_eap (setting, type));
+	set_val_str (arr, 3, nmc_property_ppp_get_refuse_pap (setting, type));
+	set_val_str (arr, 4, nmc_property_ppp_get_refuse_chap (setting, type));
+	set_val_str (arr, 5, nmc_property_ppp_get_refuse_mschap (setting, type));
+	set_val_str (arr, 6, nmc_property_ppp_get_refuse_mschapv2 (setting, type));
+	set_val_str (arr, 7, nmc_property_ppp_get_nobsdcomp (setting, type));
+	set_val_str (arr, 8, nmc_property_ppp_get_nodeflate (setting, type));
+	set_val_str (arr, 9, nmc_property_ppp_get_no_vj_comp (setting, type));
+	set_val_str (arr, 10, nmc_property_ppp_get_require_mppe (setting, type));
+	set_val_str (arr, 11, nmc_property_ppp_get_require_mppe_128 (setting, type));
+	set_val_str (arr, 12, nmc_property_ppp_get_mppe_stateful (setting, type));
+	set_val_str (arr, 13, nmc_property_ppp_get_crtscts (setting, type));
+	set_val_str (arr, 14, nmc_property_ppp_get_baud (setting, type));
+	set_val_str (arr, 15, nmc_property_ppp_get_mru (setting, type));
+	set_val_str (arr, 16, nmc_property_ppp_get_mtu (setting, type));
+	set_val_str (arr, 17, nmc_property_ppp_get_lcp_echo_failure (setting, type));
+	set_val_str (arr, 18, nmc_property_ppp_get_lcp_echo_interval (setting, type));
 	g_ptr_array_add (nmc->output_data, arr);
 
 	print_data (nmc);  /* Print all data */
@@ -8860,7 +9083,11 @@ setting_ppp_details (NMSetting *setting, NmCli *nmc,  const char *one_prop, gboo
 }
 
 static gboolean
-setting_pppoe_details (NMSetting *setting, NmCli *nmc,  const char *one_prop, gboolean secrets)
+setting_pppoe_details (NMSetting *setting,
+                       NmCli *nmc,
+                       const char *one_prop,
+                       gboolean secrets,
+                       NmcPropertyGetType type)
 {
 	NMSettingPppoe *s_pppoe = NM_SETTING_PPPOE (setting);
 	NmcOutputField *tmpl, *arr;
@@ -8877,10 +9104,10 @@ setting_pppoe_details (NMSetting *setting, NmCli *nmc,  const char *one_prop, gb
 
 	arr = nmc_dup_fields_array (tmpl, tmpl_len, NMC_OF_FLAG_SECTION_PREFIX);
 	set_val_str (arr, 0, g_strdup (nm_setting_get_name (setting)));
-	set_val_str (arr, 1, nmc_property_pppoe_get_service (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 2, nmc_property_pppoe_get_username (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 3, GET_SECRET (secrets, setting, nmc_property_pppoe_get_password));
-	set_val_str (arr, 4, nmc_property_pppoe_get_password_flags (setting, NMC_PROPERTY_GET_PRETTY));
+	set_val_str (arr, 1, nmc_property_pppoe_get_service (setting, type));
+	set_val_str (arr, 2, nmc_property_pppoe_get_username (setting, type));
+	set_val_str (arr, 3, GET_SECRET (secrets, setting, nmc_property_pppoe_get_password, type));
+	set_val_str (arr, 4, nmc_property_pppoe_get_password_flags (setting, type));
 	g_ptr_array_add (nmc->output_data, arr);
 
 	print_data (nmc);  /* Print all data */
@@ -8889,7 +9116,11 @@ setting_pppoe_details (NMSetting *setting, NmCli *nmc,  const char *one_prop, gb
 }
 
 static gboolean
-setting_gsm_details (NMSetting *setting, NmCli *nmc,  const char *one_prop, gboolean secrets)
+setting_gsm_details (NMSetting *setting,
+                     NmCli *nmc,
+                     const char *one_prop,
+                     gboolean secrets,
+                     NmcPropertyGetType type)
 {
 	NMSettingGsm *s_gsm = NM_SETTING_GSM (setting);
 	NmcOutputField *tmpl, *arr;
@@ -8906,18 +9137,19 @@ setting_gsm_details (NMSetting *setting, NmCli *nmc,  const char *one_prop, gboo
 
 	arr = nmc_dup_fields_array (tmpl, tmpl_len, NMC_OF_FLAG_SECTION_PREFIX);
 	set_val_str (arr, 0, g_strdup (nm_setting_get_name (setting)));
-	set_val_str (arr, 1, nmc_property_gsm_get_number (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 2, nmc_property_gsm_get_username (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 3, GET_SECRET (secrets, setting, nmc_property_gsm_get_password));
-	set_val_str (arr, 4, nmc_property_gsm_get_password_flags (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 5, nmc_property_gsm_get_apn (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 6, nmc_property_gsm_get_network_id (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 7, GET_SECRET (secrets, setting, nmc_property_gsm_get_pin));
-	set_val_str (arr, 8, nmc_property_gsm_get_pin_flags (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 9, nmc_property_gsm_get_home_only (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 10, nmc_property_gsm_get_device_id (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 11, nmc_property_gsm_get_sim_id (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 12, nmc_property_gsm_get_sim_operator_id (setting, NMC_PROPERTY_GET_PRETTY));
+	set_val_str (arr, 1, nmc_property_gsm_get_number (setting, type));
+	set_val_str (arr, 2, nmc_property_gsm_get_username (setting, type));
+	set_val_str (arr, 3, GET_SECRET (secrets, setting, nmc_property_gsm_get_password, type));
+	set_val_str (arr, 4, nmc_property_gsm_get_password_flags (setting, type));
+	set_val_str (arr, 5, nmc_property_gsm_get_apn (setting, type));
+	set_val_str (arr, 6, nmc_property_gsm_get_network_id (setting, type));
+	set_val_str (arr, 7, GET_SECRET (secrets, setting, nmc_property_gsm_get_pin, type));
+	set_val_str (arr, 8, nmc_property_gsm_get_pin_flags (setting, type));
+	set_val_str (arr, 9, nmc_property_gsm_get_home_only (setting, type));
+	set_val_str (arr, 10, nmc_property_gsm_get_device_id (setting, type));
+	set_val_str (arr, 11, nmc_property_gsm_get_sim_id (setting, type));
+	set_val_str (arr, 12, nmc_property_gsm_get_sim_operator_id (setting, type));
+	set_val_str (arr, 13, nmc_property_gsm_get_mtu (setting, type));
 	g_ptr_array_add (nmc->output_data, arr);
 
 	print_data (nmc);  /* Print all data */
@@ -8926,7 +9158,11 @@ setting_gsm_details (NMSetting *setting, NmCli *nmc,  const char *one_prop, gboo
 }
 
 static gboolean
-setting_cdma_details (NMSetting *setting, NmCli *nmc,  const char *one_prop, gboolean secrets)
+setting_cdma_details (NMSetting *setting,
+                      NmCli *nmc,
+                      const char *one_prop,
+                      gboolean secrets,
+                      NmcPropertyGetType type)
 {
 	NMSettingCdma *s_cdma = NM_SETTING_CDMA (setting);
 	NmcOutputField *tmpl, *arr;
@@ -8943,10 +9179,11 @@ setting_cdma_details (NMSetting *setting, NmCli *nmc,  const char *one_prop, gbo
 
 	arr = nmc_dup_fields_array (tmpl, tmpl_len, NMC_OF_FLAG_SECTION_PREFIX);
 	set_val_str (arr, 0, g_strdup (nm_setting_get_name (setting)));
-	set_val_str (arr, 1, nmc_property_cdma_get_number (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 2, nmc_property_cdma_get_username (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 3, GET_SECRET (secrets, setting, nmc_property_cdma_get_password));
-	set_val_str (arr, 4, nmc_property_cdma_get_password_flags (setting, NMC_PROPERTY_GET_PRETTY));
+	set_val_str (arr, 1, nmc_property_cdma_get_number (setting, type));
+	set_val_str (arr, 2, nmc_property_cdma_get_username (setting, type));
+	set_val_str (arr, 3, GET_SECRET (secrets, setting, nmc_property_cdma_get_password, type));
+	set_val_str (arr, 4, nmc_property_cdma_get_password_flags (setting, type));
+	set_val_str (arr, 5, nmc_property_cdma_get_mtu (setting, type));
 	g_ptr_array_add (nmc->output_data, arr);
 
 	print_data (nmc);  /* Print all data */
@@ -8955,7 +9192,11 @@ setting_cdma_details (NMSetting *setting, NmCli *nmc,  const char *one_prop, gbo
 }
 
 static gboolean
-setting_bluetooth_details (NMSetting *setting, NmCli *nmc,  const char *one_prop, gboolean secrets)
+setting_bluetooth_details (NMSetting *setting,
+                           NmCli *nmc,
+                           const char *one_prop,
+                           gboolean secrets,
+                           NmcPropertyGetType type)
 {
 	NMSettingBluetooth *s_bluetooth = NM_SETTING_BLUETOOTH (setting);
 	NmcOutputField *tmpl, *arr;
@@ -8972,8 +9213,8 @@ setting_bluetooth_details (NMSetting *setting, NmCli *nmc,  const char *one_prop
 
 	arr = nmc_dup_fields_array (tmpl, tmpl_len, NMC_OF_FLAG_SECTION_PREFIX);
 	set_val_str (arr, 0, g_strdup (nm_setting_get_name (setting)));
-	set_val_str (arr, 1, nmc_property_bluetooth_get_bdaddr (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 2, nmc_property_bluetooth_get_type (setting, NMC_PROPERTY_GET_PRETTY));
+	set_val_str (arr, 1, nmc_property_bluetooth_get_bdaddr (setting, type));
+	set_val_str (arr, 2, nmc_property_bluetooth_get_type (setting, type));
 	g_ptr_array_add (nmc->output_data, arr);
 
 	print_data (nmc);  /* Print all data */
@@ -8982,7 +9223,11 @@ setting_bluetooth_details (NMSetting *setting, NmCli *nmc,  const char *one_prop
 }
 
 static gboolean
-setting_olpc_mesh_details (NMSetting *setting, NmCli *nmc,  const char *one_prop, gboolean secrets)
+setting_olpc_mesh_details (NMSetting *setting,
+                           NmCli *nmc,
+                           const char *one_prop,
+                           gboolean secrets,
+                           NmcPropertyGetType type)
 {
 	NMSettingOlpcMesh *s_olpc_mesh = NM_SETTING_OLPC_MESH (setting);
 	NmcOutputField *tmpl, *arr;
@@ -8999,9 +9244,9 @@ setting_olpc_mesh_details (NMSetting *setting, NmCli *nmc,  const char *one_prop
 
 	arr = nmc_dup_fields_array (tmpl, tmpl_len, NMC_OF_FLAG_SECTION_PREFIX);
 	set_val_str (arr, 0, g_strdup (nm_setting_get_name (setting)));
-	set_val_str (arr, 1, nmc_property_olpc_get_ssid (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 2, nmc_property_olpc_get_channel (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 3, nmc_property_olpc_get_anycast_address (setting, NMC_PROPERTY_GET_PRETTY));
+	set_val_str (arr, 1, nmc_property_olpc_get_ssid (setting, type));
+	set_val_str (arr, 2, nmc_property_olpc_get_channel (setting, type));
+	set_val_str (arr, 3, nmc_property_olpc_get_anycast_address (setting, type));
 	g_ptr_array_add (nmc->output_data, arr);
 
 	print_data (nmc);  /* Print all data */
@@ -9010,7 +9255,11 @@ setting_olpc_mesh_details (NMSetting *setting, NmCli *nmc,  const char *one_prop
 }
 
 static gboolean
-setting_vpn_details (NMSetting *setting, NmCli *nmc,  const char *one_prop, gboolean secrets)
+setting_vpn_details (NMSetting *setting,
+                     NmCli *nmc,
+                     const char *one_prop,
+                     gboolean secrets,
+                     NmcPropertyGetType type)
 {
 	NMSettingVpn *s_vpn = NM_SETTING_VPN (setting);
 	NmcOutputField *tmpl, *arr;
@@ -9027,12 +9276,12 @@ setting_vpn_details (NMSetting *setting, NmCli *nmc,  const char *one_prop, gboo
 
 	arr = nmc_dup_fields_array (tmpl, tmpl_len, NMC_OF_FLAG_SECTION_PREFIX);
 	set_val_str (arr, 0, g_strdup (nm_setting_get_name (setting)));
-	set_val_str (arr, 1, nmc_property_vpn_get_service_type (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 2, nmc_property_vpn_get_user_name (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 3, nmc_property_vpn_get_data (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 4, GET_SECRET (secrets, setting, nmc_property_vpn_get_secrets));
-	set_val_str (arr, 5, nmc_property_vpn_get_persistent (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 6, nmc_property_vpn_get_timeout (setting, NMC_PROPERTY_GET_PRETTY));
+	set_val_str (arr, 1, nmc_property_vpn_get_service_type (setting, type));
+	set_val_str (arr, 2, nmc_property_vpn_get_user_name (setting, type));
+	set_val_str (arr, 3, nmc_property_vpn_get_data (setting, type));
+	set_val_str (arr, 4, GET_SECRET (secrets, setting, nmc_property_vpn_get_secrets, type));
+	set_val_str (arr, 5, nmc_property_vpn_get_persistent (setting, type));
+	set_val_str (arr, 6, nmc_property_vpn_get_timeout (setting, type));
 	g_ptr_array_add (nmc->output_data, arr);
 
 	print_data (nmc);  /* Print all data */
@@ -9041,7 +9290,11 @@ setting_vpn_details (NMSetting *setting, NmCli *nmc,  const char *one_prop, gboo
 }
 
 static gboolean
-setting_wimax_details (NMSetting *setting, NmCli *nmc,  const char *one_prop, gboolean secrets)
+setting_wimax_details (NMSetting *setting,
+                       NmCli *nmc,
+                       const char *one_prop,
+                       gboolean secrets,
+                       NmcPropertyGetType type)
 {
 	NMSettingWimax *s_wimax = NM_SETTING_WIMAX (setting);
 	NmcOutputField *tmpl, *arr;
@@ -9058,8 +9311,8 @@ setting_wimax_details (NMSetting *setting, NmCli *nmc,  const char *one_prop, gb
 
 	arr = nmc_dup_fields_array (tmpl, tmpl_len, NMC_OF_FLAG_SECTION_PREFIX);
 	set_val_str (arr, 0, g_strdup (nm_setting_get_name (setting)));
-	set_val_str (arr, 1, nmc_property_wimax_get_mac_address (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 2, nmc_property_wimax_get_network_name (setting, NMC_PROPERTY_GET_PRETTY));
+	set_val_str (arr, 1, nmc_property_wimax_get_mac_address (setting, type));
+	set_val_str (arr, 2, nmc_property_wimax_get_network_name (setting, type));
 	g_ptr_array_add (nmc->output_data, arr);
 
 	print_data (nmc);  /* Print all data */
@@ -9068,7 +9321,11 @@ setting_wimax_details (NMSetting *setting, NmCli *nmc,  const char *one_prop, gb
 }
 
 static gboolean
-setting_infiniband_details (NMSetting *setting, NmCli *nmc,  const char *one_prop, gboolean secrets)
+setting_infiniband_details (NMSetting *setting,
+                            NmCli *nmc,
+                            const char *one_prop,
+                            gboolean secrets,
+                            NmcPropertyGetType type)
 {
 	NMSettingInfiniband *s_infiniband = NM_SETTING_INFINIBAND (setting);
 	NmcOutputField *tmpl, *arr;
@@ -9085,11 +9342,11 @@ setting_infiniband_details (NMSetting *setting, NmCli *nmc,  const char *one_pro
 
 	arr = nmc_dup_fields_array (tmpl, tmpl_len, NMC_OF_FLAG_SECTION_PREFIX);
 	set_val_str (arr, 0, g_strdup (nm_setting_get_name (setting)));
-	set_val_str (arr, 1, nmc_property_ib_get_mac_address (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 2, nmc_property_ib_get_mtu (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 3, nmc_property_ib_get_transport_mode (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 4, nmc_property_ib_get_p_key (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 5, nmc_property_ib_get_parent (setting, NMC_PROPERTY_GET_PRETTY));
+	set_val_str (arr, 1, nmc_property_ib_get_mac_address (setting, type));
+	set_val_str (arr, 2, nmc_property_ib_get_mtu (setting, type));
+	set_val_str (arr, 3, nmc_property_ib_get_transport_mode (setting, type));
+	set_val_str (arr, 4, nmc_property_ib_get_p_key (setting, type));
+	set_val_str (arr, 5, nmc_property_ib_get_parent (setting, type));
 	g_ptr_array_add (nmc->output_data, arr);
 
 	print_data (nmc);  /* Print all data */
@@ -9098,7 +9355,11 @@ setting_infiniband_details (NMSetting *setting, NmCli *nmc,  const char *one_pro
 }
 
 static gboolean
-setting_bond_details (NMSetting *setting, NmCli *nmc,  const char *one_prop, gboolean secrets)
+setting_bond_details (NMSetting *setting,
+                      NmCli *nmc,
+                      const char *one_prop,
+                      gboolean secrets,
+                      NmcPropertyGetType type)
 {
 	NMSettingBond *s_bond = NM_SETTING_BOND (setting);
 	NmcOutputField *tmpl, *arr;
@@ -9115,7 +9376,7 @@ setting_bond_details (NMSetting *setting, NmCli *nmc,  const char *one_prop, gbo
 
 	arr = nmc_dup_fields_array (tmpl, tmpl_len, NMC_OF_FLAG_SECTION_PREFIX);
 	set_val_str (arr, 0, g_strdup (nm_setting_get_name (setting)));
-	set_val_str (arr, 1, nmc_property_bond_get_options (setting, NMC_PROPERTY_GET_PRETTY));
+	set_val_str (arr, 1, nmc_property_bond_get_options (setting, type));
 	g_ptr_array_add (nmc->output_data, arr);
 
 	print_data (nmc);  /* Print all data */
@@ -9124,7 +9385,11 @@ setting_bond_details (NMSetting *setting, NmCli *nmc,  const char *one_prop, gbo
 }
 
 static gboolean
-setting_vlan_details (NMSetting *setting, NmCli *nmc,  const char *one_prop, gboolean secrets)
+setting_vlan_details (NMSetting *setting,
+                      NmCli *nmc,
+                      const char *one_prop,
+                      gboolean secrets,
+                      NmcPropertyGetType type)
 {
 	NMSettingVlan *s_vlan = NM_SETTING_VLAN (setting);
 	NmcOutputField *tmpl, *arr;
@@ -9141,11 +9406,11 @@ setting_vlan_details (NMSetting *setting, NmCli *nmc,  const char *one_prop, gbo
 
 	arr = nmc_dup_fields_array (tmpl, tmpl_len, NMC_OF_FLAG_SECTION_PREFIX);
 	set_val_str (arr, 0, g_strdup (nm_setting_get_name (setting)));
-	set_val_str (arr, 1, nmc_property_vlan_get_parent (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 2, nmc_property_vlan_get_id (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 3, nmc_property_vlan_get_flags (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 4, nmc_property_vlan_get_ingress_priority_map (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 5, nmc_property_vlan_get_egress_priority_map (setting, NMC_PROPERTY_GET_PRETTY));
+	set_val_str (arr, 1, nmc_property_vlan_get_parent (setting, type));
+	set_val_str (arr, 2, nmc_property_vlan_get_id (setting, type));
+	set_val_str (arr, 3, nmc_property_vlan_get_flags (setting, type));
+	set_val_str (arr, 4, nmc_property_vlan_get_ingress_priority_map (setting, type));
+	set_val_str (arr, 5, nmc_property_vlan_get_egress_priority_map (setting, type));
 	g_ptr_array_add (nmc->output_data, arr);
 
 	print_data (nmc);  /* Print all data */
@@ -9154,7 +9419,11 @@ setting_vlan_details (NMSetting *setting, NmCli *nmc,  const char *one_prop, gbo
 }
 
 static gboolean
-setting_adsl_details (NMSetting *setting, NmCli *nmc,  const char *one_prop, gboolean secrets)
+setting_adsl_details (NMSetting *setting,
+                      NmCli *nmc,
+                      const char *one_prop,
+                      gboolean secrets,
+                      NmcPropertyGetType type)
 {
 	NMSettingAdsl *s_adsl = NM_SETTING_ADSL (setting);
 	NmcOutputField *tmpl, *arr;
@@ -9171,13 +9440,13 @@ setting_adsl_details (NMSetting *setting, NmCli *nmc,  const char *one_prop, gbo
 
 	arr = nmc_dup_fields_array (tmpl, tmpl_len, NMC_OF_FLAG_SECTION_PREFIX);
 	set_val_str (arr, 0, g_strdup (nm_setting_get_name (setting)));
-	set_val_str (arr, 1, nmc_property_adsl_get_username (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 2, GET_SECRET (secrets, setting, nmc_property_adsl_get_password));
-	set_val_str (arr, 3, nmc_property_adsl_get_password_flags (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 4, nmc_property_adsl_get_protocol (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 5, nmc_property_adsl_get_encapsulation (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 6, nmc_property_adsl_get_vpi (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 7, nmc_property_adsl_get_vci (setting, NMC_PROPERTY_GET_PRETTY));
+	set_val_str (arr, 1, nmc_property_adsl_get_username (setting, type));
+	set_val_str (arr, 2, GET_SECRET (secrets, setting, nmc_property_adsl_get_password, type));
+	set_val_str (arr, 3, nmc_property_adsl_get_password_flags (setting, type));
+	set_val_str (arr, 4, nmc_property_adsl_get_protocol (setting, type));
+	set_val_str (arr, 5, nmc_property_adsl_get_encapsulation (setting, type));
+	set_val_str (arr, 6, nmc_property_adsl_get_vpi (setting, type));
+	set_val_str (arr, 7, nmc_property_adsl_get_vci (setting, type));
 	g_ptr_array_add (nmc->output_data, arr);
 
 	print_data (nmc);  /* Print all data */
@@ -9186,7 +9455,11 @@ setting_adsl_details (NMSetting *setting, NmCli *nmc,  const char *one_prop, gbo
 }
 
 static gboolean
-setting_bridge_details (NMSetting *setting, NmCli *nmc,  const char *one_prop, gboolean secrets)
+setting_bridge_details (NMSetting *setting,
+                        NmCli *nmc,
+                        const char *one_prop,
+                        gboolean secrets,
+                        NmcPropertyGetType type)
 {
 	NMSettingBridge *s_bridge = NM_SETTING_BRIDGE (setting);
 	NmcOutputField *tmpl, *arr;
@@ -9203,14 +9476,14 @@ setting_bridge_details (NMSetting *setting, NmCli *nmc,  const char *one_prop, g
 
 	arr = nmc_dup_fields_array (tmpl, tmpl_len, NMC_OF_FLAG_SECTION_PREFIX);
 	set_val_str (arr, 0, g_strdup (nm_setting_get_name (setting)));
-	set_val_str (arr, 1, nmc_property_bridge_get_mac_address (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 2, nmc_property_bridge_get_stp (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 3, nmc_property_bridge_get_priority (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 4, nmc_property_bridge_get_forward_delay (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 5, nmc_property_bridge_get_hello_time (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 6, nmc_property_bridge_get_max_age (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 7, nmc_property_bridge_get_ageing_time (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 8, nmc_property_bridge_get_multicast_snooping (setting, NMC_PROPERTY_GET_PRETTY));
+	set_val_str (arr, 1, nmc_property_bridge_get_mac_address (setting, type));
+	set_val_str (arr, 2, nmc_property_bridge_get_stp (setting, type));
+	set_val_str (arr, 3, nmc_property_bridge_get_priority (setting, type));
+	set_val_str (arr, 4, nmc_property_bridge_get_forward_delay (setting, type));
+	set_val_str (arr, 5, nmc_property_bridge_get_hello_time (setting, type));
+	set_val_str (arr, 6, nmc_property_bridge_get_max_age (setting, type));
+	set_val_str (arr, 7, nmc_property_bridge_get_ageing_time (setting, type));
+	set_val_str (arr, 8, nmc_property_bridge_get_multicast_snooping (setting, type));
 	g_ptr_array_add (nmc->output_data, arr);
 
 	print_data (nmc);  /* Print all data */
@@ -9219,7 +9492,11 @@ setting_bridge_details (NMSetting *setting, NmCli *nmc,  const char *one_prop, g
 }
 
 static gboolean
-setting_bridge_port_details (NMSetting *setting, NmCli *nmc,  const char *one_prop, gboolean secrets)
+setting_bridge_port_details (NMSetting *setting,
+                             NmCli *nmc,
+                             const char *one_prop,
+                             gboolean secrets,
+                             NmcPropertyGetType type)
 {
 	NMSettingBridgePort *s_bridge_port = NM_SETTING_BRIDGE_PORT (setting);
 	NmcOutputField *tmpl, *arr;
@@ -9236,9 +9513,9 @@ setting_bridge_port_details (NMSetting *setting, NmCli *nmc,  const char *one_pr
 
 	arr = nmc_dup_fields_array (tmpl, tmpl_len, NMC_OF_FLAG_SECTION_PREFIX);
 	set_val_str (arr, 0, g_strdup (nm_setting_get_name (setting)));
-	set_val_str (arr, 1, nmc_property_bridge_port_get_priority (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 2, nmc_property_bridge_port_get_path_cost (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 3, nmc_property_bridge_port_get_hairpin_mode (setting, NMC_PROPERTY_GET_PRETTY));
+	set_val_str (arr, 1, nmc_property_bridge_port_get_priority (setting, type));
+	set_val_str (arr, 2, nmc_property_bridge_port_get_path_cost (setting, type));
+	set_val_str (arr, 3, nmc_property_bridge_port_get_hairpin_mode (setting, type));
 	g_ptr_array_add (nmc->output_data, arr);
 
 	print_data (nmc);  /* Print all data */
@@ -9247,7 +9524,11 @@ setting_bridge_port_details (NMSetting *setting, NmCli *nmc,  const char *one_pr
 }
 
 static gboolean
-setting_team_details (NMSetting *setting, NmCli *nmc,  const char *one_prop, gboolean secrets)
+setting_team_details (NMSetting *setting,
+                      NmCli *nmc,
+                      const char *one_prop,
+                      gboolean secrets,
+                      NmcPropertyGetType type)
 {
 	NMSettingTeam *s_team = NM_SETTING_TEAM (setting);
 	NmcOutputField *tmpl, *arr;
@@ -9264,7 +9545,7 @@ setting_team_details (NMSetting *setting, NmCli *nmc,  const char *one_prop, gbo
 
 	arr = nmc_dup_fields_array (tmpl, tmpl_len, NMC_OF_FLAG_SECTION_PREFIX);
 	set_val_str (arr, 0, g_strdup (nm_setting_get_name (setting)));
-	set_val_str (arr, 1, nmc_property_team_get_config (setting, NMC_PROPERTY_GET_PRETTY));
+	set_val_str (arr, 1, nmc_property_team_get_config (setting, type));
 	g_ptr_array_add (nmc->output_data, arr);
 
 	print_data (nmc);  /* Print all data */
@@ -9273,7 +9554,11 @@ setting_team_details (NMSetting *setting, NmCli *nmc,  const char *one_prop, gbo
 }
 
 static gboolean
-setting_team_port_details (NMSetting *setting, NmCli *nmc,  const char *one_prop, gboolean secrets)
+setting_team_port_details (NMSetting *setting,
+                           NmCli *nmc,
+                           const char *one_prop,
+                           gboolean secrets,
+                           NmcPropertyGetType type)
 {
 	NMSettingTeamPort *s_team_port = NM_SETTING_TEAM_PORT (setting);
 	NmcOutputField *tmpl, *arr;
@@ -9290,7 +9575,7 @@ setting_team_port_details (NMSetting *setting, NmCli *nmc,  const char *one_prop
 
 	arr = nmc_dup_fields_array (tmpl, tmpl_len, NMC_OF_FLAG_SECTION_PREFIX);
 	set_val_str (arr, 0, g_strdup (nm_setting_get_name (setting)));
-	set_val_str (arr, 1, nmc_property_team_port_get_config (setting, NMC_PROPERTY_GET_PRETTY));
+	set_val_str (arr, 1, nmc_property_team_port_get_config (setting, type));
 	g_ptr_array_add (nmc->output_data, arr);
 
 	print_data (nmc);  /* Print all data */
@@ -9299,7 +9584,11 @@ setting_team_port_details (NMSetting *setting, NmCli *nmc,  const char *one_prop
 }
 
 static gboolean
-setting_dcb_details (NMSetting *setting, NmCli *nmc,  const char *one_prop, gboolean secrets)
+setting_dcb_details (NMSetting *setting,
+                     NmCli *nmc,
+                     const char *one_prop,
+                     gboolean secrets,
+                     NmcPropertyGetType type)
 {
 	NMSettingDcb *s_dcb = NM_SETTING_DCB (setting);
 	NmcOutputField *tmpl, *arr;
@@ -9316,21 +9605,21 @@ setting_dcb_details (NMSetting *setting, NmCli *nmc,  const char *one_prop, gboo
 
 	arr = nmc_dup_fields_array (tmpl, tmpl_len, NMC_OF_FLAG_SECTION_PREFIX);
 	set_val_str (arr, 0, g_strdup (nm_setting_get_name (setting)));
-	set_val_str (arr, 1, nmc_property_dcb_get_app_fcoe_flags (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 2, nmc_property_dcb_get_app_fcoe_priority (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 3, nmc_property_dcb_get_app_fcoe_mode (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 4, nmc_property_dcb_get_app_iscsi_flags (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 5, nmc_property_dcb_get_app_iscsi_priority (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 6, nmc_property_dcb_get_app_fip_flags (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 7, nmc_property_dcb_get_app_fip_priority (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 8, nmc_property_dcb_get_pfc_flags (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 9, nmc_property_dcb_get_pfc (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 10, nmc_property_dcb_get_pg_flags (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 11, nmc_property_dcb_get_pg_group_id (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 12, nmc_property_dcb_get_pg_group_bandwidth (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 13, nmc_property_dcb_get_pg_bandwidth (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 14, nmc_property_dcb_get_pg_strict (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 15, nmc_property_dcb_get_pg_traffic_class (setting, NMC_PROPERTY_GET_PRETTY));
+	set_val_str (arr, 1, nmc_property_dcb_get_app_fcoe_flags (setting, type));
+	set_val_str (arr, 2, nmc_property_dcb_get_app_fcoe_priority (setting, type));
+	set_val_str (arr, 3, nmc_property_dcb_get_app_fcoe_mode (setting, type));
+	set_val_str (arr, 4, nmc_property_dcb_get_app_iscsi_flags (setting, type));
+	set_val_str (arr, 5, nmc_property_dcb_get_app_iscsi_priority (setting, type));
+	set_val_str (arr, 6, nmc_property_dcb_get_app_fip_flags (setting, type));
+	set_val_str (arr, 7, nmc_property_dcb_get_app_fip_priority (setting, type));
+	set_val_str (arr, 8, nmc_property_dcb_get_pfc_flags (setting, type));
+	set_val_str (arr, 9, nmc_property_dcb_get_pfc (setting, type));
+	set_val_str (arr, 10, nmc_property_dcb_get_pg_flags (setting, type));
+	set_val_str (arr, 11, nmc_property_dcb_get_pg_group_id (setting, type));
+	set_val_str (arr, 12, nmc_property_dcb_get_pg_group_bandwidth (setting, type));
+	set_val_str (arr, 13, nmc_property_dcb_get_pg_bandwidth (setting, type));
+	set_val_str (arr, 14, nmc_property_dcb_get_pg_strict (setting, type));
+	set_val_str (arr, 15, nmc_property_dcb_get_pg_traffic_class (setting, type));
 	g_ptr_array_add (nmc->output_data, arr);
 
 	print_data (nmc);  /* Print all data */
@@ -9339,7 +9628,11 @@ setting_dcb_details (NMSetting *setting, NmCli *nmc,  const char *one_prop, gboo
 }
 
 static gboolean
-setting_tun_details (NMSetting *setting, NmCli *nmc,  const char *one_prop, gboolean secrets)
+setting_tun_details (NMSetting *setting,
+                     NmCli *nmc,
+                     const char *one_prop,
+                     gboolean secrets,
+                     NmcPropertyGetType type)
 {
 	NMSettingTun *s_tun = NM_SETTING_TUN (setting);
 	NmcOutputField *tmpl, *arr;
@@ -9356,12 +9649,12 @@ setting_tun_details (NMSetting *setting, NmCli *nmc,  const char *one_prop, gboo
 
 	arr = nmc_dup_fields_array (tmpl, tmpl_len, NMC_OF_FLAG_SECTION_PREFIX);
 	set_val_str (arr, 0, g_strdup (nm_setting_get_name (setting)));
-	set_val_str (arr, 1, nmc_property_tun_get_mode (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 2, nmc_property_tun_get_owner (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 3, nmc_property_tun_get_group (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 4, nmc_property_tun_get_pi (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 5, nmc_property_tun_get_vnet_hdr (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 6, nmc_property_tun_get_multi_queue (setting, NMC_PROPERTY_GET_PRETTY));
+	set_val_str (arr, 1, nmc_property_tun_get_mode (setting, type));
+	set_val_str (arr, 2, nmc_property_tun_get_owner (setting, type));
+	set_val_str (arr, 3, nmc_property_tun_get_group (setting, type));
+	set_val_str (arr, 4, nmc_property_tun_get_pi (setting, type));
+	set_val_str (arr, 5, nmc_property_tun_get_vnet_hdr (setting, type));
+	set_val_str (arr, 6, nmc_property_tun_get_multi_queue (setting, type));
 	g_ptr_array_add (nmc->output_data, arr);
 
 	print_data (nmc);  /* Print all data */
@@ -9370,7 +9663,11 @@ setting_tun_details (NMSetting *setting, NmCli *nmc,  const char *one_prop, gboo
 }
 
 static gboolean
-setting_ip_tunnel_details (NMSetting *setting, NmCli *nmc,  const char *one_prop, gboolean secrets)
+setting_ip_tunnel_details (NMSetting *setting,
+                           NmCli *nmc,
+                           const char *one_prop,
+                           gboolean secrets,
+                           NmcPropertyGetType type)
 {
 	NMSettingIPTunnel *s_ip_tunnel = NM_SETTING_IP_TUNNEL (setting);
 	NmcOutputField *tmpl, *arr;
@@ -9387,18 +9684,18 @@ setting_ip_tunnel_details (NMSetting *setting, NmCli *nmc,  const char *one_prop
 
 	arr = nmc_dup_fields_array (tmpl, tmpl_len, NMC_OF_FLAG_SECTION_PREFIX);
 	set_val_str (arr, 0, g_strdup (nm_setting_get_name (setting)));
-	set_val_str (arr, 1, nmc_property_ip_tunnel_get_mode (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 2, nmc_property_ip_tunnel_get_parent (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 3, nmc_property_ip_tunnel_get_local (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 4, nmc_property_ip_tunnel_get_remote (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 5, nmc_property_ip_tunnel_get_ttl (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 6, nmc_property_ip_tunnel_get_tos (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 7, nmc_property_ip_tunnel_get_path_mtu_discovery (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 8, nmc_property_ip_tunnel_get_input_key (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 9, nmc_property_ip_tunnel_get_output_key (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 10, nmc_property_ip_tunnel_get_encapsulation_limit (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 11, nmc_property_ip_tunnel_get_flow_label (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 12, nmc_property_ip_tunnel_get_mtu (setting, NMC_PROPERTY_GET_PRETTY));
+	set_val_str (arr, 1, nmc_property_ip_tunnel_get_mode (setting, type));
+	set_val_str (arr, 2, nmc_property_ip_tunnel_get_parent (setting, type));
+	set_val_str (arr, 3, nmc_property_ip_tunnel_get_local (setting, type));
+	set_val_str (arr, 4, nmc_property_ip_tunnel_get_remote (setting, type));
+	set_val_str (arr, 5, nmc_property_ip_tunnel_get_ttl (setting, type));
+	set_val_str (arr, 6, nmc_property_ip_tunnel_get_tos (setting, type));
+	set_val_str (arr, 7, nmc_property_ip_tunnel_get_path_mtu_discovery (setting, type));
+	set_val_str (arr, 8, nmc_property_ip_tunnel_get_input_key (setting, type));
+	set_val_str (arr, 9, nmc_property_ip_tunnel_get_output_key (setting, type));
+	set_val_str (arr, 10, nmc_property_ip_tunnel_get_encapsulation_limit (setting, type));
+	set_val_str (arr, 11, nmc_property_ip_tunnel_get_flow_label (setting, type));
+	set_val_str (arr, 12, nmc_property_ip_tunnel_get_mtu (setting, type));
 	g_ptr_array_add (nmc->output_data, arr);
 
 	print_data (nmc);  /* Print all data */
@@ -9407,7 +9704,11 @@ setting_ip_tunnel_details (NMSetting *setting, NmCli *nmc,  const char *one_prop
 }
 
 static gboolean
-setting_macsec_details (NMSetting *setting, NmCli *nmc,  const char *one_prop, gboolean secrets)
+setting_macsec_details (NMSetting *setting,
+                        NmCli *nmc,
+                        const char *one_prop,
+                        gboolean secrets,
+                        NmcPropertyGetType type)
 {
 	NMSettingMacsec *s_macsec = NM_SETTING_MACSEC (setting);
 	NmcOutputField *tmpl, *arr;
@@ -9424,14 +9725,14 @@ setting_macsec_details (NMSetting *setting, NmCli *nmc,  const char *one_prop, g
 
 	arr = nmc_dup_fields_array (tmpl, tmpl_len, NMC_OF_FLAG_SECTION_PREFIX);
 	set_val_str (arr, 0, g_strdup (nm_setting_get_name (setting)));
-	set_val_str (arr, 1, nmc_property_macsec_get_parent (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 2, nmc_property_macsec_get_mode (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 3, nmc_property_macsec_get_encrypt (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 4, GET_SECRET (secrets, setting, nmc_property_macsec_get_mka_cak));
-	set_val_str (arr, 5, nmc_property_macsec_get_mka_cak_flags (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 6, nmc_property_macsec_get_mka_ckn (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 7, nmc_property_macsec_get_port (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 8, nmc_property_macsec_get_validation (setting, NMC_PROPERTY_GET_PRETTY));
+	set_val_str (arr, 1, nmc_property_macsec_get_parent (setting, type));
+	set_val_str (arr, 2, nmc_property_macsec_get_mode (setting, type));
+	set_val_str (arr, 3, nmc_property_macsec_get_encrypt (setting, type));
+	set_val_str (arr, 4, GET_SECRET (secrets, setting, nmc_property_macsec_get_mka_cak, type));
+	set_val_str (arr, 5, nmc_property_macsec_get_mka_cak_flags (setting, type));
+	set_val_str (arr, 6, nmc_property_macsec_get_mka_ckn (setting, type));
+	set_val_str (arr, 7, nmc_property_macsec_get_port (setting, type));
+	set_val_str (arr, 8, nmc_property_macsec_get_validation (setting, type));
 	g_ptr_array_add (nmc->output_data, arr);
 
 	print_data (nmc);  /* Print all data */
@@ -9440,7 +9741,11 @@ setting_macsec_details (NMSetting *setting, NmCli *nmc,  const char *one_prop, g
 }
 
 static gboolean
-setting_macvlan_details (NMSetting *setting, NmCli *nmc,  const char *one_prop, gboolean secrets)
+setting_macvlan_details (NMSetting *setting,
+                         NmCli *nmc,
+                         const char *one_prop,
+                         gboolean secrets,
+                         NmcPropertyGetType type)
 {
 	NMSettingMacvlan *s_macvlan = NM_SETTING_MACVLAN (setting);
 	NmcOutputField *tmpl, *arr;
@@ -9457,10 +9762,10 @@ setting_macvlan_details (NMSetting *setting, NmCli *nmc,  const char *one_prop,
 
 	arr = nmc_dup_fields_array (tmpl, tmpl_len, NMC_OF_FLAG_SECTION_PREFIX);
 	set_val_str (arr, 0, g_strdup (nm_setting_get_name (setting)));
-	set_val_str (arr, 1, nmc_property_macvlan_get_parent (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 2, nmc_property_macvlan_get_mode (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 3, nmc_property_macvlan_get_promiscuous (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 4, nmc_property_macvlan_get_tap (setting, NMC_PROPERTY_GET_PRETTY));
+	set_val_str (arr, 1, nmc_property_macvlan_get_parent (setting, type));
+	set_val_str (arr, 2, nmc_property_macvlan_get_mode (setting, type));
+	set_val_str (arr, 3, nmc_property_macvlan_get_promiscuous (setting, type));
+	set_val_str (arr, 4, nmc_property_macvlan_get_tap (setting, type));
 	g_ptr_array_add (nmc->output_data, arr);
 
 	print_data (nmc);  /* Print all data */
@@ -9469,7 +9774,11 @@ setting_macvlan_details (NMSetting *setting, NmCli *nmc,  const char *one_prop,
 }
 
 static gboolean
-setting_vxlan_details (NMSetting *setting, NmCli *nmc,  const char *one_prop, gboolean secrets)
+setting_vxlan_details (NMSetting *setting,
+                       NmCli *nmc,
+                       const char *one_prop,
+                       gboolean secrets,
+                       NmcPropertyGetType type)
 {
 	NMSettingVxlan *s_vxlan = NM_SETTING_VXLAN (setting);
 	NmcOutputField *tmpl, *arr;
@@ -9486,22 +9795,22 @@ setting_vxlan_details (NMSetting *setting, NmCli *nmc,  const char *one_prop, gb
 
 	arr = nmc_dup_fields_array (tmpl, tmpl_len, NMC_OF_FLAG_SECTION_PREFIX);
 	set_val_str (arr, 0, g_strdup (nm_setting_get_name (setting)));
-	set_val_str (arr, 1, nmc_property_vxlan_get_parent (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 2, nmc_property_vxlan_get_id (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 3, nmc_property_vxlan_get_local (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 4, nmc_property_vxlan_get_remote (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 5, nmc_property_vxlan_get_source_port_min (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 6, nmc_property_vxlan_get_source_port_max (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 7, nmc_property_vxlan_get_destination_port (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 8, nmc_property_vxlan_get_tos (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 9, nmc_property_vxlan_get_ttl (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 10, nmc_property_vxlan_get_ageing (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 11, nmc_property_vxlan_get_limit (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 12, nmc_property_vxlan_get_learning (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 13, nmc_property_vxlan_get_proxy (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 14, nmc_property_vxlan_get_rsc (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 15, nmc_property_vxlan_get_l2_miss (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 16, nmc_property_vxlan_get_l3_miss (setting, NMC_PROPERTY_GET_PRETTY));
+	set_val_str (arr, 1, nmc_property_vxlan_get_parent (setting, type));
+	set_val_str (arr, 2, nmc_property_vxlan_get_id (setting, type));
+	set_val_str (arr, 3, nmc_property_vxlan_get_local (setting, type));
+	set_val_str (arr, 4, nmc_property_vxlan_get_remote (setting, type));
+	set_val_str (arr, 5, nmc_property_vxlan_get_source_port_min (setting, type));
+	set_val_str (arr, 6, nmc_property_vxlan_get_source_port_max (setting, type));
+	set_val_str (arr, 7, nmc_property_vxlan_get_destination_port (setting, type));
+	set_val_str (arr, 8, nmc_property_vxlan_get_tos (setting, type));
+	set_val_str (arr, 9, nmc_property_vxlan_get_ttl (setting, type));
+	set_val_str (arr, 10, nmc_property_vxlan_get_ageing (setting, type));
+	set_val_str (arr, 11, nmc_property_vxlan_get_limit (setting, type));
+	set_val_str (arr, 12, nmc_property_vxlan_get_learning (setting, type));
+	set_val_str (arr, 13, nmc_property_vxlan_get_proxy (setting, type));
+	set_val_str (arr, 14, nmc_property_vxlan_get_rsc (setting, type));
+	set_val_str (arr, 15, nmc_property_vxlan_get_l2_miss (setting, type));
+	set_val_str (arr, 16, nmc_property_vxlan_get_l3_miss (setting, type));
 	g_ptr_array_add (nmc->output_data, arr);
 
 	print_data (nmc);  /* Print all data */
@@ -9510,7 +9819,11 @@ setting_vxlan_details (NMSetting *setting, NmCli *nmc,  const char *one_prop, gb
 }
 
 static gboolean
-setting_proxy_details (NMSetting *setting, NmCli *nmc,  const char *one_prop, gboolean secrets)
+setting_proxy_details (NMSetting *setting,
+                       NmCli *nmc,
+                       const char *one_prop,
+                       gboolean secrets,
+                       NmcPropertyGetType type)
 {
 	NMSettingProxy *s_proxy = NM_SETTING_PROXY (setting);
 	NmcOutputField *tmpl, *arr;
@@ -9527,10 +9840,10 @@ setting_proxy_details (NMSetting *setting, NmCli *nmc,  const char *one_prop, gb
 
 	arr = nmc_dup_fields_array (tmpl, tmpl_len, NMC_OF_FLAG_SECTION_PREFIX);
 	set_val_str (arr, 0, g_strdup (nm_setting_get_name (setting)));
-	set_val_str (arr, 1, nmc_property_proxy_get_method (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 2, nmc_property_proxy_get_browser_only (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 3, nmc_property_proxy_get_pac_url (setting, NMC_PROPERTY_GET_PRETTY));
-	set_val_str (arr, 4, nmc_property_proxy_get_pac_script (setting, NMC_PROPERTY_GET_PRETTY));
+	set_val_str (arr, 1, nmc_property_proxy_get_method (setting, type));
+	set_val_str (arr, 2, nmc_property_proxy_get_browser_only (setting, type));
+	set_val_str (arr, 3, nmc_property_proxy_get_pac_url (setting, type));
+	set_val_str (arr, 4, nmc_property_proxy_get_pac_script (setting, type));
 	g_ptr_array_add (nmc->output_data, arr);
 
 	print_data (nmc);  /* Print all data */
@@ -9540,7 +9853,11 @@ setting_proxy_details (NMSetting *setting, NmCli *nmc,  const char *one_prop, gb
 
 typedef struct {
 	const char *sname;
-	gboolean (*func) (NMSetting *setting, NmCli *nmc,  const char *one_prop, gboolean secrets);
+	gboolean (*func) (NMSetting *setting,
+	                  NmCli *nmc,
+	                  const char *one_prop,
+	                  gboolean secrets,
+	                  NmcPropertyGetType type);
 } SettingDetails;
 
 static const SettingDetails detail_printers[] = {
@@ -9582,12 +9899,16 @@ gboolean
 setting_details (NMSetting *setting, NmCli *nmc,  const char *one_prop, gboolean secrets)
 {
 	const SettingDetails *iter = &detail_printers[0];
+	NmcPropertyGetType type = NMC_PROPERTY_GET_PRETTY;
 
 	g_return_val_if_fail (NM_IS_SETTING (setting), FALSE);
 
+	if (nmc->print_output == NMC_PRINT_TERSE)
+		type = NMC_PROPERTY_GET_PARSABLE;
+
 	while (iter->sname) {
 		if (nm_setting_lookup_type (iter->sname) == G_OBJECT_TYPE (setting))
-			return iter->func (setting, nmc, one_prop, secrets);
+			return iter->func (setting, nmc, one_prop, secrets, type);
 		iter++;
 	}
 
diff --git a/clients/cli/settings.h b/clients/cli/settings.h
index ad503f9e..f663aa46 100644
--- a/clients/cli/settings.h
+++ b/clients/cli/settings.h
@@ -95,5 +95,6 @@ extern NmcOutputField nmc_fields_setting_macvlan[];
 extern NmcOutputField nmc_fields_setting_macsec[];
 extern NmcOutputField nmc_fields_setting_vxlan[];
 extern NmcOutputField nmc_fields_setting_proxy[];
+extern NmcOutputField nmc_fields_setting_dummy[];
 
 #endif /* NMC_SETTINGS_H */
diff --git a/clients/cli/utils.c b/clients/cli/utils.c
index ff98276a..24686ec7 100644
--- a/clients/cli/utils.c
+++ b/clients/cli/utils.c
@@ -28,27 +28,90 @@
 #include <arpa/inet.h>
 
 #include "utils.h"
+#include "common.h"
 
-int
+gboolean
 matches (const char *cmd, const char *pattern)
 {
 	size_t len = strlen (cmd);
 	if (!len || len > strlen (pattern))
-		return -1;
-	return memcmp (pattern, cmd, len);
+		return FALSE;
+	return memcmp (pattern, cmd, len) == 0;
 }
 
+static gboolean
+parse_global_arg (NmCli *nmc, const char *arg)
+{
+	if (nmc_arg_is_option (arg, "ask"))
+		nmc->ask = TRUE;
+	else if (nmc_arg_is_option (arg, "show-secrets"))
+		nmc->show_secrets = TRUE;
+	else
+		return FALSE;
+
+	return TRUE;
+}
+/**
+ * next_arg:
+ * @nmc: NmCli data
+ * @*argc: pointer to left number of arguments to parse
+ * @***argv: pointer to const char *array of arguments still to parse
+ * @...: a %NULL terminated list of cmd options to match (e.g., "--active")
+ *
+ * Takes care of autocompleting options when needed and performs
+ * match against passed options while moving forward the pointer
+ * to the remaining arguments.
+ *
+ * Returns: the number of the matched option  if a match is found against
+ * one of the custom options passed; 0 if no custom option matched and still
+ * some args need to be processed or autocompletion has been performed;
+ * -1 otherwise (no more args).
+ */
 int
-next_arg (int *argc, char ***argv)
+next_arg (NmCli *nmc, int *argc, char ***argv, ...)
 {
-	int arg_num = *argc;
+	va_list args;
+	const char *cmd_option;
 
-	if (arg_num > 0) {
-		(*argc)--;
-		(*argv)++;
-	}
-	if (arg_num <= 1)
-		return -1;
+	g_assert (*argc >= 0);
+
+	do {
+		int cmd_option_pos = 1;
+
+		if (*argc > 0) {
+			(*argc)--;
+			(*argv)++;
+		}
+		if (*argc == 0)
+			return -1;
+
+
+		va_start (args, argv);
+
+		if (nmc && nmc->complete && *argc == 1) {
+			while ((cmd_option = va_arg (args, const char *)))
+				nmc_complete_strings (**argv, cmd_option, NULL);
+
+			if (***argv == '-')
+				nmc_complete_strings (**argv, "--ask", "--show-secrets", NULL);
+
+			va_end (args);
+			return 0;
+		}
+
+		/* Check command dependent options first */
+		while ((cmd_option = va_arg (args, const char *))) {
+			/* strip heading "--" form cmd_option */
+			if (nmc_arg_is_option (**argv, cmd_option + 2)) {
+				va_end (args);
+				return cmd_option_pos;
+			}
+			cmd_option_pos++;
+		}
+
+		va_end (args);
+
+	} while (nmc && parse_global_arg (nmc, **argv));
 
 	return 0;
 }
@@ -58,9 +121,9 @@ nmc_arg_is_help (const char *arg)
 {
 	if (!arg)
 		return FALSE;
-	if (   matches (arg, "help") == 0
-	    || (g_str_has_prefix (arg, "-")  && matches (arg+1, "help") == 0)
-	    || (g_str_has_prefix (arg, "--") && matches (arg+2, "help") == 0)) {
+	if (   matches (arg, "help")
+	    || (g_str_has_prefix (arg, "-")  && matches (arg + 1, "help"))
+	    || (g_str_has_prefix (arg, "--") && matches (arg + 2, "help"))) {
 		return TRUE;
 	}
 	return FALSE;
@@ -79,10 +142,9 @@ nmc_arg_is_option (const char *str, const char *opt_name)
 
 	p = (str[1] == '-') ? str + 2 : str + 1;
 
-	return (*p ? (matches (p, opt_name) == 0) : FALSE);
+	return (*p ? matches (p, opt_name) : FALSE);
 }
 
-
 /*
  * Helper function to parse command-line arguments.
  * arg_arr: description of arguments to look for
@@ -117,7 +179,9 @@ nmc_parse_args (nmc_arg_t *arg_arr, gboolean last, int *argc, char ***argv, GErr
 				}
 
 				if (p->has_value) {
-					if (next_arg (argc, argv) != 0) {
+					(*argc)--;
+					(*argv)++;
+					if (!*argc) {
 						g_set_error (error, NMCLI_ERROR, NMC_RESULT_ERROR_USER_INPUT,
 						             _("Error: value for '%s' argument is required."), *(*argv-1));
 						return FALSE;
@@ -151,7 +215,7 @@ nmc_parse_args (nmc_arg_t *arg_arr, gboolean last, int *argc, char ***argv, GErr
 			return FALSE;
 		}
 
-		next_arg (argc, argv);
+		next_arg (NULL, argc, argv, NULL);
 	}
 
 	return TRUE;
@@ -941,24 +1005,6 @@ nmc_get_allowed_fields (const NmcOutputField fields_array[], int group_idx)
 	return g_string_free (allowed_fields, FALSE);
 }
 
-gboolean
-nmc_terse_option_check (NMCPrintOutput print_output, const char *fields, GError **error)
-{
-	g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
-
-	if (print_output == NMC_PRINT_TERSE) {
-		if (!fields) {
-			g_set_error_literal (error, NMCLI_ERROR, 0, _("Option '--terse' requires specifying '--fields'"));
-			return FALSE;
-		} else if (   !strcasecmp (fields, "all")
-		           || !strcasecmp (fields, "common")) {
-			g_set_error (error, NMCLI_ERROR, 0, _("Option '--terse' requires specific '--fields' option values , not '%s'"), fields);
-			return FALSE;
-		}
-	}
-	return TRUE;
-}
-
 NmcOutputField *
 nmc_dup_fields_array (NmcOutputField fields[], size_t size, guint32 flags)
 {
@@ -992,54 +1038,55 @@ nmc_empty_output_fields (NmCli *nmc)
 	}
 }
 
-static char *
+static const char *
 colorize_string (NmCli *nmc,
                  NmcTermColor color,
                  NmcTermFormat color_fmt,
                  const char *str,
-                 gboolean *dealloc)
+                 char **out_to_free)
 {
-	char *out;
+	const char *out = str;
 
 	if (   use_colors (nmc)
 	    && (color != NMC_TERM_COLOR_NORMAL || color_fmt != NMC_TERM_FORMAT_NORMAL)) {
-		out = nmc_colorize (nmc, color, color_fmt, "%s", str);
-		*dealloc = TRUE;
-	} else {
-		out = (char *) str;
-		*dealloc = FALSE;
+		*out_to_free = nmc_colorize (nmc, color, color_fmt, "%s", str);
+		out = *out_to_free;
 	}
+
 	return out;
 }
 
-static char *
+static const char *
 get_value_to_print (NmCli *nmc,
                     NmcOutputField *field,
                     gboolean field_name,
                     const char *not_set_str,
-                    gboolean *dealloc)
+                    char **out_to_free)
 {
 	gboolean is_array = field->value_is_array;
-	char *value, *out;
-	gboolean free_value, free_out;
+	char *value;
+	const char *out;
+	gboolean free_value;
 
 	if (field_name)
 		value = _(field->name_l10n);
 	else
-		value = field->value ?
-		          (is_array ? g_strjoinv (" | ", (char **) field->value) :
-		                      (char *) field->value) :
-		          (char *) not_set_str;
+		value = field->value
+		            ? (is_array
+		                  ? g_strjoinv (" | ", (char **) field->value)
+		                  : (*((char *) field->value)
+		                        ? (char *) field->value
+		                        : (char *) not_set_str))
+		            : (char *) not_set_str;
 	free_value = field->value && is_array && !field_name;
 
 	/* colorize the value */
-	out = colorize_string (nmc, field->color, field->color_fmt, value, &free_out);
-	if (free_out) {
+	out = colorize_string (nmc, field->color, field->color_fmt, value, out_to_free);
+	if (*out_to_free) {
 		if (free_value)
 			g_free (value);
-		 *dealloc = TRUE;
-	} else
-		 *dealloc = free_value;
+	} else if (free_value)
+		 *out_to_free = value;
 
 	return out;
 }
@@ -1072,104 +1119,111 @@ print_required_fields (NmCli *nmc, const NmcOutputField field_values[])
 	gboolean section_prefix = field_values[0].flags & NMC_OF_FLAG_SECTION_PREFIX;
 	gboolean main_header = main_header_add || main_header_only;
 
-	/* No headers are printed in terse mode:
-	 * - neither main header nor field (column) names
-	 */
-	if ((main_header_only || field_names) && terse)
-		return;
+	enum { ML_HEADER_WIDTH = 79 };
+	enum { ML_VALUE_INDENT = 40 };
 
-	if (multiline) {
-	/* --- Multiline mode --- */
-		enum { ML_HEADER_WIDTH = 79 };
-		enum { ML_VALUE_INDENT = 40 };
-		if (main_header && pretty) {
-			/* Print the main header */
-			int header_width = nmc_string_screen_width (fields.header_name, NULL) + 4;
-			table_width = header_width < ML_HEADER_WIDTH ? ML_HEADER_WIDTH : header_width;
 
+	/* --- Main header --- */
+	if (main_header && pretty) {
+		int header_width = nmc_string_screen_width (fields.header_name, NULL) + 4;
+
+		if (multiline) {
+			table_width = header_width < ML_HEADER_WIDTH ? ML_HEADER_WIDTH : header_width;
 			line = g_strnfill (ML_HEADER_WIDTH, '=');
-			width1 = strlen (fields.header_name);
-			width2 = nmc_string_screen_width (fields.header_name, NULL);
-			g_print ("%s\n", line);
-			g_print ("%*s\n", (table_width + width2)/2 + width1 - width2, fields.header_name);
-			g_print ("%s\n", line);
-			g_free (line);
+		} else { /* tabular */
+			table_width = table_width < header_width ? header_width : table_width;
+			line = g_strnfill (table_width, '=');
 		}
 
-		/* Print values */
-		if (!main_header_only && !field_names) {
-			for (i = 0; i < fields.indices->len; i++) {
-				char *tmp;
-				gboolean free_print_val;
-				int idx = g_array_index (fields.indices, int, i);
-				gboolean is_array = field_values[idx].value_is_array;
-
-				/* section prefix can't be an array */
-				g_assert (!is_array || !section_prefix || idx != 0);
-
-				if (section_prefix && idx == 0)  /* The first field is section prefix */
-					continue;
-
-				if (is_array) {
-					/* value is a null-terminated string array */
-					const char **p, *val;
-					char *print_val;
-					int j;
-
-					for (p = (const char **) field_values[idx].value, j = 1; p && *p; p++, j++) {
-						val = *p ? *p : not_set_str;
-						print_val = colorize_string (nmc, field_values[idx].color, field_values[idx].color_fmt,
-						                             val, &free_print_val);
-						tmp = g_strdup_printf ("%s%s%s[%d]:",
-						                       section_prefix ? (const char*) field_values[0].value : "",
-						                       section_prefix ? "." : "",
-						                       _(field_values[idx].name_l10n),
-						                       j);
-						width1 = strlen (tmp);
-						width2 = nmc_string_screen_width (tmp, NULL);
-						g_print ("%-*s%s\n", terse ? 0 : ML_VALUE_INDENT+width1-width2, tmp, print_val);
-						g_free (tmp);
-						if (free_print_val)
-							g_free (print_val);
-					}
-				} else {
-					/* value is a string */
-					const char *hdr_name = (const char*) field_values[0].value;
-					const char *val = (const char*) field_values[idx].value;
-					char *print_val;
+		width1 = strlen (fields.header_name);
+		width2 = nmc_string_screen_width (fields.header_name, NULL);
+		g_print ("%s\n", line);
+		g_print ("%*s\n", (table_width + width2)/2 + width1 - width2, fields.header_name);
+		g_print ("%s\n", line);
+		g_free (line);
+	}
+
+	if (main_header_only)
+		return;
+
+	/* No field headers are printed in terse mode nor for multiline output */
+	if ((terse || multiline) && field_names)
+		return;
+
+	if (terse)
+		not_set_str = ""; /* Don't replace empty strings in terse mode */
+
+
+	if (multiline) {
+		for (i = 0; i < fields.indices->len; i++) {
+			char *tmp;
+			int idx = g_array_index (fields.indices, int, i);
+			gboolean is_array = field_values[idx].value_is_array;
 
-					val = val ? val : not_set_str;
+			/* section prefix can't be an array */
+			g_assert (!is_array || !section_prefix || idx != 0);
+
+			if (section_prefix && idx == 0)  /* The first field is section prefix */
+				continue;
+
+			if (is_array) {
+				/* value is a null-terminated string array */
+				const char **p, *val, *print_val;
+				gs_free char *val_to_free = NULL;
+				int j;
+
+				for (p = (const char **) field_values[idx].value, j = 1; p && *p; p++, j++) {
+					val = *p ? *p : not_set_str;
 					print_val = colorize_string (nmc, field_values[idx].color, field_values[idx].color_fmt,
-					                             val, &free_print_val);
-					tmp = g_strdup_printf ("%s%s%s:",
-					                       section_prefix ? hdr_name : "",
+					                             val, &val_to_free);
+					tmp = g_strdup_printf ("%s%s%s[%d]:",
+					                       section_prefix ? (const char*) field_values[0].value : "",
 					                       section_prefix ? "." : "",
-					                       _(field_values[idx].name_l10n));
+					                       _(field_values[idx].name_l10n),
+					                       j);
 					width1 = strlen (tmp);
 					width2 = nmc_string_screen_width (tmp, NULL);
 					g_print ("%-*s%s\n", terse ? 0 : ML_VALUE_INDENT+width1-width2, tmp, print_val);
 					g_free (tmp);
-					if (free_print_val)
-						g_free (print_val);
 				}
+			} else {
+				/* value is a string */
+				const char *hdr_name = (const char*) field_values[0].value;
+				const char *val = (const char*) field_values[idx].value;
+				const char *print_val;
+				gs_free char *val_to_free = NULL;
+
+				val = val && *val ? val : not_set_str;
+				print_val = colorize_string (nmc, field_values[idx].color, field_values[idx].color_fmt,
+				                             val, &val_to_free);
+				tmp = g_strdup_printf ("%s%s%s:",
+				                       section_prefix ? hdr_name : "",
+				                       section_prefix ? "." : "",
+				                       _(field_values[idx].name_l10n));
+				width1 = strlen (tmp);
+				width2 = nmc_string_screen_width (tmp, NULL);
+				g_print ("%-*s%s\n", terse ? 0 : ML_VALUE_INDENT+width1-width2, tmp, print_val);
+				g_free (tmp);
 			}
-			if (pretty) {
-				line = g_strnfill (ML_HEADER_WIDTH, '-');
-				g_print ("%s\n", line);
-				g_free (line);
-			}
 		}
+		if (pretty) {
+			line = g_strnfill (ML_HEADER_WIDTH, '-');
+			g_print ("%s\n", line);
+			g_free (line);
+		}
+
 		return;
 	}
 
 	/* --- Tabular mode: each line = one object --- */
+
 	str = g_string_new (NULL);
 
 	for (i = 0; i < fields.indices->len; i++) {
 		int idx = g_array_index (fields.indices, int, i);
-		gboolean dealloc;
-		char *value = get_value_to_print (nmc, (NmcOutputField *) field_values+idx, field_names,
-		                                  not_set_str, &dealloc);
+		gs_free char *val_to_free = NULL;
+		const char *value = get_value_to_print (nmc, (NmcOutputField *) field_values+idx, field_names,
+		                                        not_set_str, &val_to_free);
 
 		if (terse) {
 			if (escape) {
@@ -1187,31 +1241,14 @@ print_required_fields (NmCli *nmc, const NmcOutputField field_values[])
 		} else {
 			width1 = strlen (value);
 			width2 = nmc_string_screen_width (value, NULL);  /* Width of the string (in screen colums) */
-			g_string_append_printf (str, "%-*s", field_values[idx].width + width1 - width2, strlen (value) > 0 ? value : "--");
+			g_string_append_printf (str, "%-*s", field_values[idx].width + width1 - width2, strlen (value) > 0 ? value : not_set_str);
 			g_string_append_c (str, ' ');  /* Column separator */
 			table_width += field_values[idx].width + width1 - width2 + 1;
 		}
-
-		if (dealloc)
-			g_free (value);
-	}
-
-	/* Print the main table header */
-	if (main_header && pretty) {
-		int header_width = nmc_string_screen_width (fields.header_name, NULL) + 4;
-		table_width = table_width < header_width ? header_width : table_width;
-
-		line = g_strnfill (table_width, '=');
-		width1 = strlen (fields.header_name);
-		width2 = nmc_string_screen_width (fields.header_name, NULL);
-		g_print ("%s\n", line);
-		g_print ("%*s\n", (table_width + width2)/2 + width1 - width2, fields.header_name);
-		g_print ("%s\n", line);
-		g_free (line);
 	}
 
 	/* Print actual values */
-	if (!main_header_only && str->len > 0) {
+	if (str->len > 0) {
 		g_string_truncate (str, str->len-1);  /* Chop off last column separator */
 		if (fields.indent > 0) {
 			indent_str = g_strnfill (fields.indent, ' ');
@@ -1219,11 +1256,9 @@ print_required_fields (NmCli *nmc, const NmcOutputField field_values[])
 			g_free (indent_str);
 		}
 		g_print ("%s\n", str->str);
-	}
 
-	/* Print horizontal separator */
-	if (!main_header_only && field_names && pretty) {
-		if (str->len > 0) {
+		/* Print horizontal separator */
+		if (field_names && pretty) {
 			line = g_strnfill (table_width, '-');
 			g_print ("%s\n", line);
 			g_free (line);
@@ -1263,15 +1298,15 @@ print_data (NmCli *nmc)
 	for (i = 0; i < num_fields; i++) {
 		size_t max_width = 0;
 		for (j = 0; j < nmc->output_data->len; j++) {
-			gboolean field_names, dealloc;
-			char *value;
+			gboolean field_names;
+			gs_free char * val_to_free = NULL;
+			const char *value;
+
 			row = g_ptr_array_index (nmc->output_data, j);
 			field_names = row[0].flags & NMC_OF_FLAG_FIELD_NAMES;
-			value = get_value_to_print (NULL, row+i, field_names, "--", &dealloc);
+			value = get_value_to_print (NULL, row+i, field_names, "--", &val_to_free);
 			len = nmc_string_screen_width (value, NULL);
 			max_width = len > max_width ? len : max_width;
-			if (dealloc)
-				g_free (value);
 		}
 		for (j = 0; j < nmc->output_data->len; j++) {
 			row = g_ptr_array_index (nmc->output_data, j);
diff --git a/clients/cli/utils.h b/clients/cli/utils.h
index 5adbd2be..a1c08764 100644
--- a/clients/cli/utils.h
+++ b/clients/cli/utils.h
@@ -39,8 +39,8 @@ typedef enum {
 } NMCTriStateValue;
 
 /* === Functions === */
-int matches (const char *cmd, const char *pattern);
-int next_arg (int *argc, char ***argv);
+gboolean matches (const char *cmd, const char *pattern);
+int next_arg (NmCli *nmc, int *argc, char ***argv, ...);
 gboolean nmc_arg_is_help (const char *arg);
 gboolean nmc_arg_is_option (const char *arg, const char *opt_name);
 gboolean nmc_parse_args (nmc_arg_t *arg_arr, gboolean last, int *argc, char ***argv, GError **error);
@@ -97,7 +97,6 @@ GArray *parse_output_fields (const char *fields_str,
                              GPtrArray **group_fields,
                              GError **error);
 char *nmc_get_allowed_fields (const NmcOutputField fields_array[], int group_idx);
-gboolean nmc_terse_option_check (NMCPrintOutput print_output, const char *fields, GError **error);
 NmcOutputField *nmc_dup_fields_array (NmcOutputField fields[], size_t size, guint32 flags);
 void nmc_empty_output_fields (NmCli *nmc);
 void print_required_fields (NmCli *nmc, const NmcOutputField field_values[]);
diff --git a/clients/common/nm-secret-agent-simple.h b/clients/common/nm-secret-agent-simple.h
index f85ba65c..2989723d 100644
--- a/clients/common/nm-secret-agent-simple.h
+++ b/clients/common/nm-secret-agent-simple.h
@@ -19,8 +19,8 @@
 #ifndef __NM_SECRET_AGENT_SIMPLE_H__
 #define __NM_SECRET_AGENT_SIMPLE_H__
 
-#include <NetworkManager.h>
-#include <nm-secret-agent-old.h>
+#include "NetworkManager.h"
+#include "nm-secret-agent-old.h"
 
 #define NM_TYPE_SECRET_AGENT_SIMPLE            (nm_secret_agent_simple_get_type ())
 #define NM_SECRET_AGENT_SIMPLE(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_SECRET_AGENT_SIMPLE, NMSecretAgentSimple))
diff --git a/clients/common/nm-vpn-helpers.h b/clients/common/nm-vpn-helpers.h
index 9ad6b3b6..9e3b8539 100644
--- a/clients/common/nm-vpn-helpers.h
+++ b/clients/common/nm-vpn-helpers.h
@@ -19,7 +19,7 @@
 #ifndef __NM_VPN_HELPERS_H__
 #define __NM_VPN_HELPERS_H__
 
-#include <NetworkManager.h>
+#include "NetworkManager.h"
 
 typedef struct {
 	const char *name;
diff --git a/clients/tui/nm-editor-bindings.h b/clients/tui/nm-editor-bindings.h
index fd4fcd30..facbf1c6 100644
--- a/clients/tui/nm-editor-bindings.h
+++ b/clients/tui/nm-editor-bindings.h
@@ -19,7 +19,7 @@
 #ifndef NM_EDITOR_BINDINGS_H
 #define NM_EDITOR_BINDINGS_H
 
-#include <NetworkManager.h>
+#include "NetworkManager.h"
 
 void nm_editor_bindings_init (void);
 
diff --git a/clients/tui/nm-editor-utils.c b/clients/tui/nm-editor-utils.c
index 90a0c83b..b71e9fbe 100644
--- a/clients/tui/nm-editor-utils.c
+++ b/clients/tui/nm-editor-utils.c
@@ -316,6 +316,33 @@ get_available_connection_name (const char *format,
 	return cname;
 }
 
+static char *
+get_available_iface_name (const char *try_name,
+                          NMClient   *client)
+{
+	const GPtrArray *connections;
+	NMConnection *connection;
+	char *new_name;
+	unsigned num = 1;
+	int i = 0;
+	const char *ifname = NULL;
+
+	connections = nm_client_get_connections (client);
+
+	new_name = g_strdup (try_name);
+	while (i < connections->len) {
+		connection = NM_CONNECTION (connections->pdata[i]);
+		ifname = nm_connection_get_interface_name (connection);
+		if (g_strcmp0 (new_name, ifname) == 0) {
+			g_free (new_name);
+			new_name = g_strdup_printf ("%s%d", try_name, num++);
+			i = 0;
+		} else
+			i++;
+	}
+	return new_name;
+}
+
 /**
  * nm_editor_utils_create_connection:
  * @type: the type of the connection's primary #NMSetting
@@ -343,7 +370,7 @@ nm_editor_utils_create_connection (GType         type,
 	NMConnection *connection;
 	NMSettingConnection *s_con;
 	NMSetting *s_hw, *s_slave;
-	char *uuid, *id;
+	char *uuid, *id, *ifname;
 	int i;
 
 	if (master) {
@@ -376,6 +403,15 @@ nm_editor_utils_create_connection (GType         type,
 	s_hw = g_object_new (type, NULL);
 	nm_connection_add_setting (connection, s_hw);
 
+	if (type == NM_TYPE_SETTING_BOND)
+		ifname = get_available_iface_name ("nm-bond", client);
+	else if (type == NM_TYPE_SETTING_TEAM)
+		ifname = get_available_iface_name ("nm-team", client);
+	else if (type == NM_TYPE_SETTING_BRIDGE)
+		ifname = get_available_iface_name ("nm-bridge", client);
+	else
+		ifname = NULL;
+
 	if (slave_setting_type != G_TYPE_INVALID) {
 		s_slave = g_object_new (slave_setting_type, NULL);
 		nm_connection_add_setting (connection, s_slave);
@@ -391,10 +427,12 @@ nm_editor_utils_create_connection (GType         type,
 	              NM_SETTING_CONNECTION_AUTOCONNECT, !type_data->no_autoconnect,
 	              NM_SETTING_CONNECTION_MASTER, master_uuid,
 	              NM_SETTING_CONNECTION_SLAVE_TYPE, master_setting_type,
+	              NM_SETTING_CONNECTION_INTERFACE_NAME, ifname,
 	              NULL);
 
 	g_free (uuid);
 	g_free (id);
+	g_free (ifname);
 
 	if (type_data->connection_setup_func)
 		type_data->connection_setup_func (connection, s_con, s_hw);
diff --git a/clients/tui/nm-editor-utils.h b/clients/tui/nm-editor-utils.h
index 15a16cd2..6f66edfe 100644
--- a/clients/tui/nm-editor-utils.h
+++ b/clients/tui/nm-editor-utils.h
@@ -19,7 +19,7 @@
 #ifndef NM_EDITOR_UTILS_H
 #define NM_EDITOR_UTILS_H
 
-#include <NetworkManager.h>
+#include "NetworkManager.h"
 
 typedef struct {
 	const char *name;
diff --git a/clients/tui/nmt-device-entry.h b/clients/tui/nmt-device-entry.h
index 4945e7c2..9278244f 100644
--- a/clients/tui/nmt-device-entry.h
+++ b/clients/tui/nmt-device-entry.h
@@ -21,7 +21,7 @@
 
 #include "nmt-editor-grid.h"
 
-#include <NetworkManager.h>
+#include "NetworkManager.h"
 
 #define NMT_TYPE_DEVICE_ENTRY            (nmt_device_entry_get_type ())
 #define NMT_DEVICE_ENTRY(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), NMT_TYPE_DEVICE_ENTRY, NmtDeviceEntry))
diff --git a/clients/tui/nmt-edit-connection-list.c b/clients/tui/nmt-edit-connection-list.c
index a1a59e01..e90140b3 100644
--- a/clients/tui/nmt-edit-connection-list.c
+++ b/clients/tui/nmt-edit-connection-list.c
@@ -319,6 +319,33 @@ listbox_activated (NmtNewtWidget *listbox, gpointer list)
 	edit_clicked (NMT_NEWT_BUTTON (priv->edit), list);
 }
 
+
+static void
+connection_saved (GObject      *conn,
+                  GAsyncResult *result,
+                  gpointer      user_data)
+{
+        nm_remote_connection_save_finish (NM_REMOTE_CONNECTION (conn), result, NULL);
+}
+
+void
+nmt_edit_connection_list_recommit (NmtEditConnectionList *list)
+{
+	NmtEditConnectionListPrivate *priv = NMT_EDIT_CONNECTION_LIST_GET_PRIVATE (list);
+	NMConnection *conn;
+	GSList *iter;
+
+	for (iter = priv->connections; iter; iter = iter->next) {
+		conn = iter->data;
+
+		if (   NM_IS_REMOTE_CONNECTION (conn)
+		    && (nm_remote_connection_get_unsaved (NM_REMOTE_CONNECTION (conn)) == FALSE)) {
+			nm_remote_connection_save_async (NM_REMOTE_CONNECTION (conn),
+			                                 NULL, connection_saved, NULL);
+		}
+	}
+}
+
 static void
 nmt_edit_connection_list_finalize (GObject *object)
 {
diff --git a/clients/tui/nmt-edit-connection-list.h b/clients/tui/nmt-edit-connection-list.h
index fd492bce..9726e287 100644
--- a/clients/tui/nmt-edit-connection-list.h
+++ b/clients/tui/nmt-edit-connection-list.h
@@ -21,7 +21,7 @@
 
 #include "nmt-newt.h"
 
-#include <NetworkManager.h>
+#include "NetworkManager.h"
 
 #define NMT_TYPE_EDIT_CONNECTION_LIST            (nmt_edit_connection_list_get_type ())
 #define NMT_EDIT_CONNECTION_LIST(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), NMT_TYPE_EDIT_CONNECTION_LIST, NmtEditConnectionList))
@@ -52,4 +52,6 @@ typedef gboolean (*NmtEditConnectionListFilter) (NmtEditConnectionList *list,
                                                  NMConnection          *connection,
                                                  gpointer               user_data);
 
+void nmt_edit_connection_list_recommit (NmtEditConnectionList *list);
+
 #endif /* NMT_EDIT_CONNECTION_LIST_H */
diff --git a/clients/tui/nmt-editor-page.c b/clients/tui/nmt-editor-page.c
index 44abe273..99475a91 100644
--- a/clients/tui/nmt-editor-page.c
+++ b/clients/tui/nmt-editor-page.c
@@ -112,6 +112,23 @@ nmt_editor_page_add_section (NmtEditorPage *page,
 	priv->sections = g_slist_append (priv->sections, g_object_ref_sink (section));
 }
 
+/**
+ * nmt_editor_page_saved:
+ * @page: the #NmtEditorPage
+ *
+ * This method is called when the user saves the connection. It gives
+ * the page a chance to do save its data outside the connections (such as
+ * recommit the slave connections).
+ */
+void
+nmt_editor_page_saved (NmtEditorPage *page)
+{
+	NmtEditorPageClass *editor_page_class = NMT_EDITOR_PAGE_GET_CLASS (page);
+
+	if (editor_page_class->saved)
+		editor_page_class->saved (page);
+}
+
 static void
 nmt_editor_page_set_property (GObject      *object,
                               guint         prop_id,
diff --git a/clients/tui/nmt-editor-page.h b/clients/tui/nmt-editor-page.h
index 8da5ea9f..93a66155 100644
--- a/clients/tui/nmt-editor-page.h
+++ b/clients/tui/nmt-editor-page.h
@@ -19,7 +19,7 @@
 #ifndef NMT_EDITOR_PAGE_H
 #define NMT_EDITOR_PAGE_H
 
-#include <NetworkManager.h>
+#include "NetworkManager.h"
 
 #include "nmt-editor-grid.h"
 #include "nmt-editor-section.h"
@@ -39,6 +39,7 @@ typedef struct {
 typedef struct {
 	GObjectClass parent;
 
+	void (*saved) (NmtEditorPage *page);
 } NmtEditorPageClass;
 
 GType nmt_editor_page_get_type (void);
@@ -47,6 +48,8 @@ NMConnection  *nmt_editor_page_get_connection    (NmtEditorPage *page);
 
 GSList        *nmt_editor_page_get_sections      (NmtEditorPage *page);
 
+void           nmt_editor_page_saved            (NmtEditorPage *page);
+
 /*< protected >*/
 void           nmt_editor_page_add_section       (NmtEditorPage *page,
                                                   NmtEditorSection *section);
diff --git a/clients/tui/nmt-editor.c b/clients/tui/nmt-editor.c
index 395e661a..515e3471 100644
--- a/clients/tui/nmt-editor.c
+++ b/clients/tui/nmt-editor.c
@@ -146,6 +146,15 @@ connection_added (GObject      *client,
 }
 
 static void
+page_saved (gpointer data, gpointer user_data)
+{
+	NmtEditorPage *page = data;
+
+	nmt_editor_page_saved (page);
+}
+
+
+static void
 save_connection_and_exit (NmtNewtButton *button,
                           gpointer       user_data)
 {
@@ -183,6 +192,9 @@ save_connection_and_exit (NmtNewtButton *button,
 		}
 	}
 
+	/* Let the page know that it was saved. */
+	g_slist_foreach (priv->pages, page_saved, NULL);
+
 	nmt_newt_form_quit (NMT_NEWT_FORM (editor));
 }
 
diff --git a/clients/tui/nmt-editor.h b/clients/tui/nmt-editor.h
index b000f64e..5620c5e8 100644
--- a/clients/tui/nmt-editor.h
+++ b/clients/tui/nmt-editor.h
@@ -19,7 +19,7 @@
 #ifndef NMT_EDITOR_H
 #define NMT_EDITOR_H
 
-#include <NetworkManager.h>
+#include "NetworkManager.h"
 
 #include "nmt-newt.h"
 
diff --git a/clients/tui/nmt-page-bond.c b/clients/tui/nmt-page-bond.c
index 259ecfc1..48070dbf 100644
--- a/clients/tui/nmt-page-bond.c
+++ b/clients/tui/nmt-page-bond.c
@@ -424,11 +424,21 @@ nmt_page_bond_constructed (GObject *object)
 }
 
 static void
+nmt_page_bond_saved (NmtEditorPage *editor_page)
+{
+	NmtPageBondPrivate *priv = NMT_PAGE_BOND_GET_PRIVATE (editor_page);
+
+	nmt_edit_connection_list_recommit (NMT_EDIT_CONNECTION_LIST (priv->slaves));
+}
+
+static void
 nmt_page_bond_class_init (NmtPageBondClass *bond_class)
 {
 	GObjectClass *object_class = G_OBJECT_CLASS (bond_class);
+	NmtEditorPageClass *editor_page_class = NMT_EDITOR_PAGE_CLASS (bond_class);
 
 	g_type_class_add_private (bond_class, sizeof (NmtPageBondPrivate));
 
 	object_class->constructed = nmt_page_bond_constructed;
+	editor_page_class->saved = nmt_page_bond_saved;
 }
diff --git a/clients/tui/nmt-page-bridge.c b/clients/tui/nmt-page-bridge.c
index b5eb9ec8..08526db4 100644
--- a/clients/tui/nmt-page-bridge.c
+++ b/clients/tui/nmt-page-bridge.c
@@ -30,6 +30,12 @@
 
 G_DEFINE_TYPE (NmtPageBridge, nmt_page_bridge, NMT_TYPE_EDITOR_PAGE_DEVICE)
 
+#define NMT_PAGE_BRIDGE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NMT_TYPE_PAGE_BRIDGE, NmtPageBridgePrivate))
+
+typedef struct {
+        NmtSlaveList *slaves;
+} NmtPageBridgePrivate;
+
 NmtEditorPage *
 nmt_page_bridge_new (NMConnection   *conn,
                      NmtDeviceEntry *deventry)
@@ -58,6 +64,7 @@ static void
 nmt_page_bridge_constructed (GObject *object)
 {
 	NmtPageBridge *bridge = NMT_PAGE_BRIDGE (object);
+	NmtPageBridgePrivate *priv = NMT_PAGE_BRIDGE_GET_PRIVATE (bridge);
 	NmtEditorSection *section;
 	NmtEditorGrid *grid;
 	NMSettingBridge *s_bridge;
@@ -80,6 +87,7 @@ nmt_page_bridge_constructed (GObject *object)
 
 	widget = nmt_slave_list_new (conn, bridge_connection_type_filter, bridge);
 	nmt_editor_grid_append (grid, NULL, widget, NULL);
+	priv->slaves = NMT_SLAVE_LIST (widget);
 
 	widget = nmt_newt_entry_numeric_new (10, 0, 1000000);
 	g_object_bind_property (s_bridge, NM_SETTING_BRIDGE_AGEING_TIME,
@@ -145,9 +153,19 @@ nmt_page_bridge_constructed (GObject *object)
 }
 
 static void
+nmt_page_bridge_saved (NmtEditorPage *editor_page)
+{
+	NmtPageBridgePrivate *priv = NMT_PAGE_BRIDGE_GET_PRIVATE (editor_page);
+
+	nmt_edit_connection_list_recommit (NMT_EDIT_CONNECTION_LIST (priv->slaves));
+}
+
+static void
 nmt_page_bridge_class_init (NmtPageBridgeClass *bridge_class)
 {
 	GObjectClass *object_class = G_OBJECT_CLASS (bridge_class);
+	NmtEditorPageClass *editor_page_class = NMT_EDITOR_PAGE_CLASS (bridge_class);
 
 	object_class->constructed = nmt_page_bridge_constructed;
+	editor_page_class->saved = nmt_page_bridge_saved;
 }
diff --git a/clients/tui/nmt-page-team.c b/clients/tui/nmt-page-team.c
index d7c4c425..2523bd85 100644
--- a/clients/tui/nmt-page-team.c
+++ b/clients/tui/nmt-page-team.c
@@ -180,11 +180,21 @@ nmt_page_team_constructed (GObject *object)
 }
 
 static void
+nmt_page_team_saved (NmtEditorPage *editor_page)
+{
+	NmtPageTeamPrivate *priv = NMT_PAGE_TEAM_GET_PRIVATE (editor_page);
+
+	nmt_edit_connection_list_recommit (NMT_EDIT_CONNECTION_LIST (priv->slaves));
+}
+
+static void
 nmt_page_team_class_init (NmtPageTeamClass *team_class)
 {
 	GObjectClass *object_class = G_OBJECT_CLASS (team_class);
+	NmtEditorPageClass *editor_page_class = NMT_EDITOR_PAGE_CLASS (team_class);
 
 	g_type_class_add_private (team_class, sizeof (NmtPageTeamPrivate));
 
 	object_class->constructed = nmt_page_team_constructed;
+	editor_page_class->saved = nmt_page_team_saved;
 }
diff --git a/clients/tui/nmt-route-editor.h b/clients/tui/nmt-route-editor.h
index febcb402..8e63830e 100644
--- a/clients/tui/nmt-route-editor.h
+++ b/clients/tui/nmt-route-editor.h
@@ -19,7 +19,7 @@
 #ifndef NMT_ROUTE_EDITOR_H
 #define NMT_ROUTE_EDITOR_H
 
-#include <NetworkManager.h>
+#include "NetworkManager.h"
 
 #include "nmt-newt.h"
 
diff --git a/clients/tui/nmtui.h b/clients/tui/nmtui.h
index 53c20cb4..efb59622 100644
--- a/clients/tui/nmtui.h
+++ b/clients/tui/nmtui.h
@@ -19,7 +19,7 @@
 #ifndef NMTUI_H
 #define NMTUI_H
 
-#include <NetworkManager.h>
+#include "NetworkManager.h"
 
 extern NMClient *nm_client;