Re: [RFC nftables PATCH] nft: add bash completion script

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Giuseppe,

On Fri, Feb 05, 2016 at 05:53:02PM +0100, Giuseppe Longo wrote:
> The following patch adds a bash completion script
> which permits to complete nft commands.
> 
> To install it:
> - cp files/nft-completion /etc/bash_completion.d/
> - . /etc/bash_completion.d/nft-completion
> 
> The following commands are supported:
> - nft add table <family> <name>
> - nft list table <family> <name>
> - nft list tables
> - nft list sets
> - nft list chains
> - nft list ruleset
> - nft list set <table> <name>
> - nft add set <table> <name>
> - nft add element <table> <set>
> - nft add map <table>
> - nft flush table <family> <table>
> 
> Most probably this won't work with sudo, since there
> are some nft commands into the script.
> 
> A second patch to add completion in interactive mode
> will come.
> 
> This is only a draft,
> any feedback is appreciated.

Could you explore adding code to inquire the parser on the next
possible tokens ahead? That would greatly simplify the shell script
for bash autocompletion. We should be able to reuse this from
libreadline too.

I know what I'm asking is a bit more difficult, but it would help us
reduce the amount of code duplication and will reduce the maintainance
burden.

Let us know, thanks!
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux