zsh-users
 help / color / mirror / code / Atom feed
From: Artur Penttinen <arto-p@yandex.ru>
To: zsh-users@zsh.org
Subject: run-help-ip heler
Date: Wed, 12 Nov 2014 16:58:29 +0300	[thread overview]
Message-ID: <140031415800709@web6h.yandex.ru> (raw)

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


             reply	other threads:[~2014-11-12 14:10 UTC|newest]

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

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=140031415800709@web6h.yandex.ru \
    --to=arto-p@yandex.ru \
    --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).