about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog3
-rw-r--r--Completion/Linux/Command/_networkmanager8
2 files changed, 10 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 4652bc6fb..002f608be 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,9 @@
 	* 43046: Completion/Unix/Type/_pdf, Completion/X/Command/_mupdf:
 	Add mupdf completer.
 
+	* 42995: David Klann: Completion/Linux/Command/_networkmanager:
+	Only complete active connections for nmcli connection down.
+
 2018-07-03  dana  <dana@dana.is>
 
 	* 43105 (tweaked): Completion/Unix/Command/_pgrep: Add full procps
diff --git a/Completion/Linux/Command/_networkmanager b/Completion/Linux/Command/_networkmanager
index 881445abb..e38215e76 100644
--- a/Completion/Linux/Command/_networkmanager
+++ b/Completion/Linux/Command/_networkmanager
@@ -102,7 +102,7 @@ _nm_connection_up() {
 }
 
 _nm_connection_down() {
-  _arguments "1:connection:_nm_connection_specs"
+  _arguments "1:connection:_nm_connection_active"
 }
 
 _nm_connection_modify() {
@@ -162,6 +162,12 @@ _nm_connection_ids() {
   _describe 'select connection' con_ids
 }
 
+_nm_connection_active() {
+  local -a con_ids
+  con_ids=(${(f)"$(_call_program nmcli nmcli -t -f name connection show --active)"})
+  _describe 'select connection' con_ids
+}
+
 _nm_device() {
   local curcontext="$curcontext" state line