netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: netfilter-devel@vger.kernel.org
Cc: ismo.puustinen@intel.com, fw@strlen.de
Subject: [PATCH nft 2/2] src: display default directory for file inclusion in -h/--help
Date: Wed,  7 Jun 2017 12:35:47 +0200	[thread overview]
Message-ID: <1496831747-9221-2-git-send-email-pablo@netfilter.org> (raw)
In-Reply-To: <1496831747-9221-1-git-send-email-pablo@netfilter.org>

If no explicit relative or absolute path is enforced by the user, nft
relies on either -I/--includepath or the default include directory that
is set at compile time.

Given most of our users will rely on packaged versions of nft, provide a
way to display the location of this default includepath directory.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
 doc/nft.xml | 5 +++++
 src/main.c  | 4 ++--
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/doc/nft.xml b/doc/nft.xml
index f93baa03d721..faf0ffde9e19 100644
--- a/doc/nft.xml
+++ b/doc/nft.xml
@@ -213,6 +213,11 @@ vi:ts=4 sw=4
 				as an absolute path.
 			</para>
 			<para>
+				If -I/--includepath is not specified, then nft relies on the default directory
+				that is specified at compile time. You can retrieve this default directory via
+				-h/--help option.
+			</para>
+			<para>
 				If the <literal>filename</literal> parameter is a directory, then all files in
 				the directory are loaded in alphabetical order.
 			</para>
diff --git a/src/main.c b/src/main.c
index 6dae817af40b..5089ff2448f3 100644
--- a/src/main.c
+++ b/src/main.c
@@ -125,12 +125,12 @@ static void show_help(const char *name)
 "  -s, --stateless		Omit stateful information of ruleset.\n"
 "  -N				Translate IP addresses to names.\n"
 "  -a, --handle			Output rule handle.\n"
-"  -I, --includepath <directory>	Add <directory> to the paths searched for include files.\n"
+"  -I, --includepath <directory>	Add <directory> to the paths searched for include files. Default is: %s\n"
 #ifdef DEBUG
 "  --debug <level [,level...]>	Specify debugging level (scanner, parser, eval, netlink, mnl, proto-ctx, segtree, all)\n"
 #endif
 "\n",
-	name);
+	name, DEFAULT_INCLUDE_PATH);
 }
 
 #ifdef DEBUG
-- 
2.1.4


      reply	other threads:[~2017-06-07 10:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-07 10:35 [PATCH nft 1/2] doc: nft: describe -I override behaviour when path starts by ./ and / Pablo Neira Ayuso
2017-06-07 10:35 ` Pablo Neira Ayuso [this message]

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=1496831747-9221-2-git-send-email-pablo@netfilter.org \
    --to=pablo@netfilter.org \
    --cc=fw@strlen.de \
    --cc=ismo.puustinen@intel.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).