zsh-workers
 help / color / mirror / code / Atom feed
* add "ip addrlabrl" competition
@ 2012-09-15 14:08 Александр Балезин
  0 siblings, 0 replies; only message in thread
From: Александр Балезин @ 2012-09-15 14:08 UTC (permalink / raw)
  To: zsh-workers


[-- Attachment #1.1: Type: text/plain, Size: 71 bytes --]

Hello. This patch add forgotten competition to addrlabel object of ip.

[-- Attachment #1.2: Type: text/html, Size: 79 bytes --]

[-- Attachment #2: add_addrlabel.diff --]
[-- Type: application/octet-stream, Size: 2092 bytes --]

diff --git a/Completion/Unix/Command/_ip b/Completion/Unix/Command/_ip
index 411af46..0fc979c 100644
--- a/Completion/Unix/Command/_ip
+++ b/Completion/Unix/Command/_ip
@@ -38,6 +38,11 @@ subcmd_ipaddrs=(
   /$'(<->(.<->(.<->(.<->|)|)|)|[:[:xdigit]]#:[:[:xdigit:]]#)(|/<->)\0'/
   ":ipaddress:IP address (v4 or v6) currently set:( $(ip addr show | sed -n 's/^ *inet6* \([0-9a-f\.:/]*\) .*$/\1/p') )"
 )
+subcmd_prefix_label=(
+  /$'(<->(.<->(.<->(.<->|)|)|)|[:[:xdigit]]#:[:[:xdigit:]]#)(|/<->)\0'/
+  ":ipaddresslabel:IP addrlabel prefix currently set:( $(ip -6 addrlabel list | sed -n 's/^prefix \([0-9a-f\.:/]*\) .*$/\1/p') )"
+)
+
 
 local -a subcmd_scope
 _regex_words scope "IP address scope" \
@@ -240,6 +245,34 @@ _regex_words \
   'f*lush:flush protocol address:$addr_show_cmds'
 addr_cmds=("$reply[@]")
 
+#
+# addrlabel
+#
+
+local -a addrlabel_add_cmds
+_regex_words addrlabel-add-commands "addlabel add command" \
+  'p*refix: limit to given IP address/prefix' \
+  'd*ev: specify device:$subcmd_dev' \
+  'l*abel: number'
+addrlabel_add_cmds=( "(" $subcmd_ipaddr "|" ")" "$reply[@]" "#")
+
+local -a addrlabel_del_cmds
+_regex_words addrlabel-add-commands "addlabel del command" \
+  'p*refix: limit to given IP address/prefix:$subcmd_prefix_label' \
+  'd*ev: specify device:$subcmd_dev' \
+  'l*abel: number:$subcmd_number'
+addrlabel_del_cmds=( "(" $subcmd_ipaddr "|" ")" "$reply[@]" "#")
+
+
+local -a addrlabel_cmds
+_regex_words \
+  addrlabel-commands "addrlabel command" \
+  'h*elp: show help for command' \
+  'a*dd: add an address labels:$addrlabel_add_cmds' \
+  'd*el: delete an address labels:$addrlabel_del_cmds' \
+  'l*ist: list address labels' \
+  'f*lush: flush adderss labels'
+addrlabel_cmds=("$reply[@]")
 
 #
 # neigh
@@ -506,6 +539,7 @@ args+=("$reply[@]" "#")
 _regex_words \
   commands "ip command" \
   'l*ink:configure network device:$link_cmds' \
+  'addrlabel:manage addrlabel:$addrlabel_cmds' \
   'a*ddr:manage protocol address:$addr_cmds' \
   'r*oute:manage routing table:$route_cmds' \
   'ru*le:manage routing policy database:$rule_cmds' \

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2012-09-15 14:15 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-15 14:08 add "ip addrlabrl" competition Александр Балезин

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).