Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
[PATCH] Completion Enhancement for Linux NetworkManager
- X-seq: zsh-workers 42995
- From: David Klann <dklann@xxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: [PATCH] Completion Enhancement for Linux NetworkManager
- Date: Wed, 13 Jun 2018 09:31:21 -0500
- Autocrypt: addr=dklann@xxxxxxxxx; prefer-encrypt=mutual; keydata= xsDiBEhJmF0RBACwU3svIw374HNS/c5hxRZReJDCHkkR4jTXISAKvqa7EqoJ8gX14/5ceWFu 3Bmekwj7WwCMf0qGaIVKAsvlRVa/oKHwPG+kYwmV8bYYo6htjZGum61AMqsDgjUdfcKIcbRr uTEN9f5+SXB+UxBQCBMQtgVgKFyE9KnwBtVQHIwuvwCgqlGT1nmOt5a2dbV86bBI4fQs9csD +wXAGgxsgYjGUwauA/tcOAjylU75nCej0InCC2BJz5J922QX82IhlnOzaO/Rz1uafC8Jm9d0 NpbalRHrou6HswRK4Atf+Rp+elD2Ks6zgjU1vTKwmRZ8Cdi5tCbBCXi4r8FrpMUKu5v0h3v1 DqSyv8ssYFr2EkXjPQ+ho5A0uzj8A/9p4wexALBh/k+891XiCmhopdtD07rry9g2PQ/WBDOJ 6SlRn+/at23RBUo0RpILg6i9EXIDNXrP2CvwkcgyekeyIQRii3SujQ3as/KzO3pR8SDgWmju Z45ab8PPqhQTuY+mTpo9Xr1Gc3k5OTYhYppnMgeaid1shh6sZK6NkHah4s0eRGF2aWQgS2xh bm4gPGRrbGFubkBsaW51eC5jb20+wmsEExECACsCGyMGCwkIBwMCBhUIAgkKCwQWAgMBAh4B AheAAhkBBQJYPvA8BQkVmPJfAAoJEHRak9Yobse8kZUAn1b239afc7QjM+BNcRhNFMkNh7lg AJ0ThNL4UFrdonZAfwT1ekDjYM/+5s7BTQRLC4B1EAgAvthOJduBbmilA/M5H9KLX7foqbA8 qL8reLRnaue5FUiAJhdUiXkAB6ypldJPWgimPSounf9ShXIsZpbTSCjEULn1Folqim23YShM 9z6Vwgc1RpGuM+k2UJ8lKLazNxmVpm4E7UA5Zqm1g74YJIBvraiFPwr32qakuMZO0GANS2cs xm8f7lCZ3jxAdHGmF6q+Ce6/MhfHwWtC/HTxLf50cS4HCj9mJ+3RzVrrY0oolSZBXncdciMc +bB/HYYs/nJjVuIqBAl8IzsJJ4DN5iG6SOd0ysNB9rhC5LS1LE3VzvzJ07QFQz5s+8xOwPZG XndTWEabChZntaSlo8ObTzSD8wADBQf/Z6hahcj2kNrzm06EIM8Emg9q68Pe/nAnZCJdQr/x ahCxMotS2FSok+NpmLpQ0QD3GqFPjljgOwK/mrcp3or4On98xIum39I66u05fb04XurT9YRB RrPLueOCsCkUUPGv2PXAIlrs1Y3UghdCM3rQzVAf3rS0wB6gsdy1Nn0hK4KEcpMJuhQVSPYT kGNZbP1Icfs55X0f+5vR1aCXUowJNbkiBA6s21xTLPGUzVLNQ826sqkEPv9asY4pcVnDptxp nsoLI6wtgIN41r2t9Nq7zr+GAMyH68Vy1jUa6NN1f8njkkXeqUJ66DLw1HXWS9pHK0EgJ7aw JgOl/uMjU4SVJMJPBBgRAgAPAhsMBQJYPvC7BQkQ9ddGAAoJEHRak9Yobse8rrcAnRZ3nIZf BXdu9tqoaGg5+Fnzrcy3AJ9vujumGXS6LxgWvTgaOehuWmHBhsLAHQQYEQIAJhYhBPQSBBUG urp9USCbYXRak9Yobse8BQJazCrNAhsiBQkSzAMAAIEJEHRak9Yobse8diAEGRYIAB0WIQTC AQ/Y/BfjYtO+Po2/XnPyBfsBeAUCWswqzQAKCRC/XnPyBfsBeERNAQCQRARU6bbYQmtKSyfu 1O7M9JXM8eKmCAfI3Xen1qIk+wEAowqqfudedo8SgatpXOAGZ0oggkUFadZMvtUuIhp3QAAa xgCgg2pd2RNz6V7W9r2iNk9e0ppOVKoAmgPk/m1irp4oJHpYFIdQrNHznYLO
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- Openpgp: preference=signencrypt
- Reply-to: dklann@xxxxxxxxx
Hi,
Here is a small patch for nmcli(1) on Linux. This is my first patch
submission. Please let me know if there is a better way to implement
this. It completes only "active" connections for the "nmcli connection
down" subcommand.
Thanks!
~David Klann
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
Attachment:
signature.asc
Description: OpenPGP digital signature
Messages sorted by:
Reverse Date,
Date,
Thread,
Author