about summary refs log tree commit diff
path: root/Completion/Linux/Command/_networkmanager
diff options
context:
space:
mode:
Diffstat (limited to 'Completion/Linux/Command/_networkmanager')
-rw-r--r--Completion/Linux/Command/_networkmanager20
1 files changed, 17 insertions, 3 deletions
diff --git a/Completion/Linux/Command/_networkmanager b/Completion/Linux/Command/_networkmanager
index fa9301971..c9b09d145 100644
--- a/Completion/Linux/Command/_networkmanager
+++ b/Completion/Linux/Command/_networkmanager
@@ -4,6 +4,7 @@
 
 _networkmanager() {
   local curcontext="$curcontext" state line
+  local nmcli="$words[1]"
 
   _arguments -C \
     '(-o -overview)-o'{,verview}'[overview mode (hide default values)]' \
@@ -107,10 +108,22 @@ _nm_connection_down() {
 }
 
 _nm_connection_modify() {
-  # TODO: add support for options and properties
-  _arguments \
+  local curcontext="$curcontext" ret=1
+  local -a state line expl properties
+
+  _arguments -A "-*" \
     "--temporary" \
-    "1:connection:_nm_connection_specs"
+    "1:connection:_nm_connection_specs" \
+    '2:option:->properties' \
+    '3:value' && ret=0
+
+  if [[ -n "$state" ]]; then
+    properties=( ${${(f)"$(_call_program properties $nmcli -t connection show $line[1])"}%%:*} )
+    _description properties expl property
+    _multi_parts "$expl[@]" . properties && ret=0
+  fi
+
+  return ret
 }
 
 _nm_connection_clone() {
@@ -245,6 +258,7 @@ _nm_device_wifi() {
 _nm_device_wifi_list() {
   # TODO: support bssid on its own
   _arguments \
+    '--rescan[force or disable network scan]:network scan:(yes no auto)' \
     "1: :(ifname)" \
     "2:interface:_nm_device_ifnames" \
     "3: :(bssid)" \