nmcli: fix "remove" command to really remove the property

When using the "remove" command on nmcli edit mode it will reset the
value to the default when no property value is specified. If the
property value is specified it will remove that specific property.

Example:

```
nmcli> set ethernet.wake-on-lan phy
nmcli> print ethernet.wake-on-lan
802-3-ethernet.wake-on-lan: phy, default
nmcli> remove ethernet.wake-on-lan default
nmcli> print ethernet.wake-on-lan
802-3-ethernet.wake-on-lan: phy
nmcli> remove ethernet.wake-on-lan
nmcli> print ethernet.wake-on-lan
802-3-ethernet.wake-on-lan: default
```
This commit is contained in:
Fernando Fernandez Mancera 2021-11-25 17:51:55 +01:00
parent ec14d7df7c
commit 624372239e

View file

@ -8005,8 +8005,9 @@ editor_menu_main(NmCli *nmc, NMConnection *connection, const char *connection_ty
if (!nmc_setting_set_property(nmc->client,
ss,
prop_name,
NM_META_ACCESSOR_MODIFIER_SET,
NULL,
cmd_arg_v ? NM_META_ACCESSOR_MODIFIER_DEL
: NM_META_ACCESSOR_MODIFIER_SET,
cmd_arg_v ? cmd_arg_v : NULL,
&tmp_err)) {
g_print(_("Error: failed to remove value of '%s': %s\n"),
prop_name,