[iptables-bash_completion] Programmable completion code (bash) for ip[6]tables

This is the programmable completion specification (compspec) for the iptables program (netfilter.org).

Features
  • Interactive completion for ip[6]tables.
  • This completion specification follows the logic of iptables and will only show commands and options, when they are available for the current context. Providing some kind of interactive help.
  • Show and complete matches, targets and builtin and/or user-defined chains.
  • Dynamically retrieve, show and complete: set names, services (port-ranges), protocols, active interfaces, cpu numbers, routing realms, user and group names, NFLOG logging groups, tc classes, nfacct names, nfct timeout policy names, genre names of the osf match.
  • Show and complete hostnames, ip/network/mac addresses.
  • Show and complete various arguments for matches and targets (those which are in any way predictable).
  • Some values entered by the user are checked for validity and completion will not continue after an invalid input.
  • Environment variables allow to modify completion behaviour.