Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

[PATCH] run-help-ip: Fix help for address and addrlabel



The `ip address` subcommand can be abbreviated to any substring,
including just `a`. A longer substring may have been looked for here to
try to reduce the likelihood of conflicts, but there still was one with
`addrlabel`. Reduce both of these patterns to the shortest substring
that is accepted by the `ip` command, and take care of the overlap by
checking for the longer pattern first.
---
 Functions/Misc/run-help-ip | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Functions/Misc/run-help-ip b/Functions/Misc/run-help-ip
index 740af52b5..8807f9ef1 100644
--- a/Functions/Misc/run-help-ip
+++ b/Functions/Misc/run-help-ip
@@ -19,8 +19,8 @@ while [[ $# != 0 && $1 == -* ]]; do
 done
 
 case $1 in
-    (addr*) man ip-address ;;
-    (addrlabel) man ip-addrlabel ;;
+    (addrl*) man ip-addrlabel ;;
+    (a*) man ip-address ;;
     (l2*) man ip-l2tp ;;
     (li*) man ip-link ;;
     (ma*) man ip-maddress ;;
-- 
2.12.1.534.g7cedf66e54



Messages sorted by: Reverse Date, Date, Thread, Author