mirror of
				git://git.code.sf.net/p/zsh/code
				synced 2025-10-31 18:10:56 +01:00 
			
		
		
		
	Александр Балезин: 30667: add addrlabl subcommand.
This commit is contained in:
		
							parent
							
								
									d2f5474fa5
								
							
						
					
					
						commit
						0c5526bec0
					
				
					 2 changed files with 40 additions and 1 deletions
				
			
		|  | @ -1,3 +1,8 @@ | |||
| 2012-09-15  Peter Stephenson  <p.w.stephenson@ntlworld.com> | ||||
| 
 | ||||
| 	* Александр Балезин: 30667: Completion/Unix/Command/_ip: add | ||||
| 	addrlabl subcommand. | ||||
| 
 | ||||
| 2012-09-11  Peter Stephenson  <pws@csr.com> | ||||
| 
 | ||||
| 	* unposted: NEWS: refer to some newly added features. | ||||
|  | @ -159,5 +164,5 @@ | |||
| 
 | ||||
| ***************************************************** | ||||
| * This is used by the shell to define $ZSH_PATCHLEVEL | ||||
| * $Revision: 1.5720 $ | ||||
| * $Revision: 1.5721 $ | ||||
| ***************************************************** | ||||
|  |  | |||
|  | @ -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' \ | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue