Fix nftables completion
- remove needless debug print - fix wrong value overwriting
This commit is contained in:
parent
f6d745a6ef
commit
d736522d58
|
|
@ -234,7 +234,7 @@ while true;do
|
||||||
#TODO
|
#TODO
|
||||||
# _nft_rule $cmd_fam $cmd_tab $cmd_chain\
|
# _nft_rule $cmd_fam $cmd_tab $cmd_chain\
|
||||||
# && return 0;
|
# && return 0;
|
||||||
descriptors=":expression: "
|
descriptors=(":expression: ")
|
||||||
nextstate="start"
|
nextstate="start"
|
||||||
;;
|
;;
|
||||||
(list-set | list-map | delete-map | list-chain | list-flowtable | delete-flowtable | list-ct\\ helper | list-counter | list-quota | list-meter)
|
(list-set | list-map | delete-map | list-chain | list-flowtable | delete-flowtable | list-ct\\ helper | list-counter | list-quota | list-meter)
|
||||||
|
|
@ -454,7 +454,6 @@ _nft_table_handle(){
|
||||||
#$1:protocol family
|
#$1:protocol family
|
||||||
local tables=( ${(f)"$(_call_program -p tables nft -a list ruleset 2>/dev/null \
|
local tables=( ${(f)"$(_call_program -p tables nft -a list ruleset 2>/dev/null \
|
||||||
| grep '^table '"$1" | sed 's/table // ;s/{ # handle // ;s/\(\S*\) \(\S*\) \(\S*\)/\3:\2(type \1)/' )"} )
|
| grep '^table '"$1" | sed 's/table // ;s/{ # handle // ;s/\(\S*\) \(\S*\) \(\S*\)/\3:\2(type \1)/' )"} )
|
||||||
echo $1 > /tmp/znfttab
|
|
||||||
_describe -t tables "table handle" tables
|
_describe -t tables "table handle" tables
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -502,3 +501,11 @@ _nft_rule_handle(){
|
||||||
|
|
||||||
#currently, only the `nft` command is covered by this script.
|
#currently, only the `nft` command is covered by this script.
|
||||||
_nft "$@"
|
_nft "$@"
|
||||||
|
|
||||||
|
# Local Variables:
|
||||||
|
# mode: Shell-Script
|
||||||
|
# sh-indentation: 2
|
||||||
|
# indent-tabs-mode: nil
|
||||||
|
# sh-basic-offset: 2
|
||||||
|
# End:
|
||||||
|
# vim: ft=zsh sw=2 ts=2 et
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue