* run-help-ip heler
@ 2014-11-12 13:58 Artur Penttinen
2014-11-12 17:06 ` Peter Stephenson
0 siblings, 1 reply; 2+ messages in thread
From: Artur Penttinen @ 2014-11-12 13:58 UTC (permalink / raw)
To: zsh-users
[-- Attachment #1: Type: text/plain, Size: 507 bytes --]
Hello!
In attach run-help helper for linux's ip command, simply copy it to your
$fpath and run
autoload -Uz run-help-ip
After that you can use run-help command for getting man
for certain ip subcommands:
# ip -o addr<F1>
# run-help ip
ip is /sbin/ip
IP-ADDRESS(8) Linux IP-ADDRESS(8)
NAME
ip-address - protocol address management
...
I hope function will be the useful.
--
wbw, artur
[-- Attachment #2: run-help-ip --]
[-- Type: application/octet-stream, Size: 794 bytes --]
#! 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
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 $?
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: run-help-ip heler
2014-11-12 13:58 run-help-ip heler Artur Penttinen
@ 2014-11-12 17:06 ` Peter Stephenson
0 siblings, 0 replies; 2+ messages in thread
From: Peter Stephenson @ 2014-11-12 17:06 UTC (permalink / raw)
To: zsh-users
On Wed, 12 Nov 2014 16:58:29 +0300
Artur Penttinen <arto-p@yandex.ru> wrote:
> Hello!
>
> In attach run-help helper for linux's ip command, simply copy it to your
> $fpath and run
>
> autoload -Uz run-help-ip
>
> After that you can use run-help command for getting man
> for certain ip subcommands:
Thanks --- I don't have the subcommand manual entries, so it might be
best to do a sanity check first, in case people are loading all run-help
helpers automatically...
pws
#! 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 $?
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-11-12 17:06 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-12 13:58 run-help-ip heler Artur Penttinen
2014-11-12 17:06 ` Peter Stephenson
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).