zsh-users
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.stephenson@samsung.com>
To: zsh-users@zsh.org
Subject: Re: run-help-ip heler
Date: Wed, 12 Nov 2014 17:06:10 +0000	[thread overview]
Message-ID: <20141112170610.19c455aa@pwslap01u.europe.root.pri> (raw)
In-Reply-To: <140031415800709@web6h.yandex.ru>

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 $?


      reply	other threads:[~2014-11-12 17:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-12 13:58 Artur Penttinen
2014-11-12 17:06 ` Peter Stephenson [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20141112170610.19c455aa@pwslap01u.europe.root.pri \
    --to=p.stephenson@samsung.com \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).