Merge pull request #1088 from Mumumu4/fix-nft-type-in-name
Fix nftables completion: when object name contains its type name
This commit is contained in:
		
						commit
						7313f8360b
					
				|  | @ -472,7 +472,7 @@ _nft_object(){ | |||
|   #$3:object type (chain/set/map/flowtable/ct helper/counter/quota/meter) | ||||
|   #$4:include 'handle'? | ||||
|   local objects=( ${(f)"$(_call_program -p objects nft -a list table $1 $2 2>/dev/null\ | ||||
|       | grep ""\\s\*$3"" | sed 's/\s*'"$3"' // ;s/ { # \(.*\)/:(\1)/' )"} ) | ||||
|       | grep ""\^\\s\*$3"" | sed 's/\s*'"$3"' // ;s/ { # \(.*\)/:(\1)/' )"} ) | ||||
|   if $4 ;then | ||||
|     objects+=( "handle:address $3 by handle") | ||||
|   fi | ||||
|  | @ -485,7 +485,7 @@ _nft_object_handle(){ | |||
|   #$2:table | ||||
|   #$3:object type (chain/set/ct helper/counter/quota) | ||||
|   local handles=( ${(f)"$(_call_program -p handles nft -a list table $1 $2 2>/dev/null\ | ||||
|       | grep ""\\s\*$3"" | sed 's/\s*'"$3"' // ;s/ { # handle// ;s/\(\S*\) \(\S*\)/\2:\1/' )"} ) | ||||
|       | grep ""\^\\s\*$3"" | sed 's/\s*'"$3"' // ;s/ { # handle// ;s/\(\S*\) \(\S*\)/\2:\1/' )"} ) | ||||
|   _describe -t handles "$3-handle" handles | ||||
| } | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue