summaryrefslogtreecommitdiff
path: root/Functions/Misc/run-help-ip
diff options
context:
space:
mode:
authorAxel Beckert <abe@deuxchevaux.org>2015-05-05 23:32:59 +0200
committerAxel Beckert <abe@deuxchevaux.org>2015-05-05 23:58:59 +0200
commitdb38e167634b6c2217eec3a5aafc37c46d9e5a8d (patch)
treedaa342d423febbd3a5a7ef97053037677fab004a /Functions/Misc/run-help-ip
parent01eea47617a6e06debdb4330f92ae69f92089fd2 (diff)
parent3c3c8d3d13fd4cf6c03f81ca8dc18a1efd561728 (diff)
downloadzsh-db38e167634b6c2217eec3a5aafc37c46d9e5a8d.tar.gz
zsh-db38e167634b6c2217eec3a5aafc37c46d9e5a8d.zip
Merge branch 'upstream' into debian
Diffstat (limited to 'Functions/Misc/run-help-ip')
-rw-r--r--Functions/Misc/run-help-ip42
1 files changed, 42 insertions, 0 deletions
diff --git a/Functions/Misc/run-help-ip b/Functions/Misc/run-help-ip
new file mode 100644
index 000000000..3f15b01fb
--- /dev/null
+++ b/Functions/Misc/run-help-ip
@@ -0,0 +1,42 @@
+#! zsh -f
+#
+# Install this function by placing it in your FPATH and then
+# adding to your .zshrc the line if you use run-help function:
+# autoload -Uz run-help-ip
+
+if [ $# -eq 0 ]; then
+ man ip
+ return
+fi
+
+if ! man -w ip-address >/dev/null 2>&1; then
+ man ip
+ return
+fi
+
+while [[ $# != 0 && $1 == -* ]]; do
+ shift
+done
+
+case $1 in
+ (addr*) man ip-address ;;
+ (addrlabel) man ip-addrlabel ;;
+ (l2*) man ip-l2tp ;;
+ (li*) man ip-link ;;
+ (ma*) man ip-maddress ;;
+ (mo*) man ip-monitor ;;
+ (mr*) man ip-mroute ;;
+ (nei*) man ip-neighbour ;;
+ (netc*) man ip-netconf ;;
+ (netn*) man ip-netns ;;
+ (nt*) man ip-ntable ;;
+ (ro*) man ip-route ;;
+ (ru*) man ip-rule ;;
+ (tcp*) man ip-tcp_metrics ;;
+ (to*) man ip-token ;;
+ (tu*) man ip-tunnel ;;
+ (xf*) man ip-xfrm ;;
+ (*) man ip ;;
+esac
+
+return $?