Fix nftables completion

- remove needless debug print
- fix wrong value overwriting
This commit is contained in:
Shohei YOSHIDA 2026-03-08 21:56:09 +09:00
parent f6d745a6ef
commit d736522d58
No known key found for this signature in database
GPG Key ID: C9A1BB11BB940CF2
1 changed files with 16 additions and 9 deletions

View File

@ -234,7 +234,7 @@ while true;do
#TODO
# _nft_rule $cmd_fam $cmd_tab $cmd_chain\
# && return 0;
descriptors=":expression: "
descriptors=(":expression: ")
nextstate="start"
;;
(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
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)/' )"} )
echo $1 > /tmp/znfttab
_describe -t tables "table handle" tables
}
@ -502,3 +501,11 @@ _nft_rule_handle(){
#currently, only the `nft` command is covered by this script.
_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