From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Giuseppe Longo <giuseppelng@gmail.com>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [RFC nftables PATCH] nft: add bash completion script
Date: Mon, 15 Feb 2016 20:56:01 +0100 [thread overview]
Message-ID: <20160215195601.GA8938@salvia> (raw)
In-Reply-To: <1454691182-6573-1-git-send-email-giuseppelng@gmail.com>
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!
next prev parent reply other threads:[~2016-02-15 19:56 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-05 16:53 [RFC nftables PATCH] nft: add bash completion script Giuseppe Longo
2016-02-06 7:56 ` AllKind
2016-02-06 20:13 ` AllKind
2016-02-15 19:56 ` Pablo Neira Ayuso [this message]
2016-02-16 13:00 ` Giuseppe Longo
2016-02-16 16:26 ` Pablo Neira Ayuso
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160215195601.GA8938@salvia \
--to=pablo@netfilter.org \
--cc=giuseppelng@gmail.com \
--cc=netfilter-devel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).