netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [nft PATCH 1/2] main: fix nft --help output fallout from 719e4427
@ 2021-02-22 12:03 Štěpán Němec
  2021-02-22 12:03 ` [nft PATCH 2/2] doc: nft: fix some typos and formatting issues Štěpán Němec
  2021-02-22 13:52 ` [nft PATCH 1/2] main: fix nft --help output fallout from 719e4427 Pablo Neira Ayuso
  0 siblings, 2 replies; 4+ messages in thread
From: Štěpán Němec @ 2021-02-22 12:03 UTC (permalink / raw)
  To: netfilter-devel, Pablo Neira Ayuso; +Cc: Phil Sutter, Jeremy Sowden

Long options were missing the double dash.

Fixes: 719e44277f8e ("main: use one data-structure to initialize getopt_long(3) arguments and help.")
Cc: Jeremy Sowden <jeremy@azazel.net>
Signed-off-by: Štěpán Němec <snemec@redhat.com>
---
 src/main.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/main.c b/src/main.c
index 80cf1acf0f7f..8c47064459ec 100644
--- a/src/main.c
+++ b/src/main.c
@@ -175,16 +175,17 @@ static const struct option *get_options(void)
 
 static void print_option(const struct nft_opt *opt)
 {
-	char optbuf[33] = "";
+	char optbuf[35] = "";
 	int i;
 
 	i = snprintf(optbuf, sizeof(optbuf), "  -%c", opt->val);
 	if (opt->name)
-		i += snprintf(optbuf + i, sizeof(optbuf) - i, ", %s", opt->name);
+		i += snprintf(optbuf + i, sizeof(optbuf) - i, ", --%s",
+			      opt->name);
 	if (opt->arg)
 		i += snprintf(optbuf + i, sizeof(optbuf) - i, " %s", opt->arg);
 
-	printf("%-32s%s\n", optbuf, opt->help);
+	printf("%-34s%s\n", optbuf, opt->help);
 }
 
 static void show_help(const char *name)
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [nft PATCH 2/2] doc: nft: fix some typos and formatting issues
  2021-02-22 12:03 [nft PATCH 1/2] main: fix nft --help output fallout from 719e4427 Štěpán Němec
@ 2021-02-22 12:03 ` Štěpán Němec
  2021-02-22 13:52   ` Pablo Neira Ayuso
  2021-02-22 13:52 ` [nft PATCH 1/2] main: fix nft --help output fallout from 719e4427 Pablo Neira Ayuso
  1 sibling, 1 reply; 4+ messages in thread
From: Štěpán Němec @ 2021-02-22 12:03 UTC (permalink / raw)
  To: netfilter-devel, Pablo Neira Ayuso; +Cc: Phil Sutter

Trying to escape asciidoc (9.1.0) * with \ preserves the backslash in
the formatted man page. Bare * works as expected.

Signed-off-by: Štěpán Němec <snemec@redhat.com>
---
 doc/nft.txt | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/doc/nft.txt b/doc/nft.txt
index 2642d8903787..32261e266aa6 100644
--- a/doc/nft.txt
+++ b/doc/nft.txt
@@ -130,7 +130,7 @@ semicolon (;). +
 A hash sign (#) begins a comment. All following characters on the same line are
 ignored. +
 
-Identifiers begin with an alphabetic character (a-z,A-Z), followed zero or more
+Identifiers begin with an alphabetic character (a-z,A-Z), followed by zero or more
 alphanumeric characters (a-z,A-Z,0-9) and the characters slash (/), backslash
 (\), underscore (_) and dot (.). Identifiers using different characters or
 clashing with a keyword need to be enclosed in double quotes (").
@@ -148,9 +148,9 @@ relative path) or / for file location expressed as an absolute path. +
 
 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. +
+directory via the *-h*/*--help* option. +
 
-Include statements support the usual shell wildcard symbols (\*,?,[]). Having no
+Include statements support the usual shell wildcard symbols (*,?,[]). Having no
 matches for an include statement is not an error, if wildcard symbols are used
 in the include statement. This allows having potentially empty include
 directories for statements like **include "/etc/firewall/rules/"**. The wildcard
@@ -164,7 +164,7 @@ SYMBOLIC VARIABLES
 *$variable*
 
 Symbolic variables can be defined using the *define* statement. Variable
-references are expressions and can be used initialize other variables. The scope
+references are expressions and can be used to initialize other variables. The scope
 of a definition is the current block and all blocks contained within.
 
 .Using symbolic variables
@@ -396,7 +396,7 @@ further quirks worth noticing:
   hook.
 
 The *priority* parameter accepts a signed integer value or a standard priority
-name which specifies the order in which chains with same *hook* value are
+name which specifies the order in which chains with the same *hook* value are
 traversed. The ordering is ascending, i.e. lower priority values have precedence
 over higher ones.
 
@@ -435,7 +435,7 @@ the others. See the following tables that describe the values and compatibility.
 Basic arithmetic expressions (addition and subtraction) can also be achieved
 with these standard names to ease relative prioritizing, e.g. *mangle - 5* stands
 for *-155*.  Values will also be printed like this until the value is not
-further than 10 form the standard value.
+further than 10 from the standard value.
 
 Base chains also allow to set the chain's *policy*, i.e.  what happens to
 packets not explicitly accepted or refused in contained rules. Supported policy
@@ -492,7 +492,7 @@ table inet filter {
 		ip saddr 10.1.1.1 tcp dport ssh accept # handle 5
 	  ...
 # delete the rule with handle 5
-# nft delete rule inet filter input handle 5
+nft delete rule inet filter input handle 5
 -------------------------
 
 SETS
@@ -534,7 +534,7 @@ identified by a user-defined name and attached to tables. Their behaviour can
 be tuned with the flags that can be specified at set creation time.
 
 [horizontal]
-*add*:: Add a new set in the specified table. See the Set specification table below for more information about how to specify a sets properties.
+*add*:: Add a new set in the specified table. See the Set specification table below for more information about how to specify properties of a set.
 *delete*:: Delete the specified set.
 *list*:: Display the elements in the specified set.
 *flush*:: Remove all elements from the specified set.
@@ -553,7 +553,7 @@ expression to derive the data type from
 set flags |
 string: constant, dynamic, interval, timeout
 |timeout |
-time an element stays in the set, mandatory if set is added to from the packet path (ruleset).|
+time an element stays in the set, mandatory if set is added to from the packet path (ruleset)|
 string, decimal followed by unit. Units are: d, h, m, s
 |gc-interval |
 garbage collection interval, only available when timeout or flag timeout are
@@ -563,7 +563,7 @@ string, decimal followed by unit. Units are: d, h, m, s
 elements contained by the set |
 set data type
 |size |
-maximum number of elements in the set, mandatory if set is added to from the packet path (ruleset).|
+maximum number of elements in the set, mandatory if set is added to from the packet path (ruleset)|
 unsigned integer (64 bit)
 |policy |
 set policy |
@@ -628,7 +628,7 @@ ____
 Element-related commands allow to change contents of named sets and maps.
 'key_expression' is typically a value matching the set type.
 'value_expression' is not allowed in sets but mandatory when adding to maps, where it
-matches the data part in it's type definition. When deleting from maps, it may
+matches the data part in its type definition. When deleting from maps, it may
 be specified but is optional as 'key_expression' uniquely identifies the
 element.
 
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [nft PATCH 1/2] main: fix nft --help output fallout from 719e4427
  2021-02-22 12:03 [nft PATCH 1/2] main: fix nft --help output fallout from 719e4427 Štěpán Němec
  2021-02-22 12:03 ` [nft PATCH 2/2] doc: nft: fix some typos and formatting issues Štěpán Němec
@ 2021-02-22 13:52 ` Pablo Neira Ayuso
  1 sibling, 0 replies; 4+ messages in thread
From: Pablo Neira Ayuso @ 2021-02-22 13:52 UTC (permalink / raw)
  To: Štěpán Němec
  Cc: netfilter-devel, Phil Sutter, Jeremy Sowden

On Mon, Feb 22, 2021 at 01:03:19PM +0100, Štěpán Němec wrote:
> Long options were missing the double dash.

Applied, thanks

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [nft PATCH 2/2] doc: nft: fix some typos and formatting issues
  2021-02-22 12:03 ` [nft PATCH 2/2] doc: nft: fix some typos and formatting issues Štěpán Němec
@ 2021-02-22 13:52   ` Pablo Neira Ayuso
  0 siblings, 0 replies; 4+ messages in thread
From: Pablo Neira Ayuso @ 2021-02-22 13:52 UTC (permalink / raw)
  To: Štěpán Němec; +Cc: netfilter-devel, Phil Sutter

On Mon, Feb 22, 2021 at 01:03:20PM +0100, Štěpán Němec wrote:
> Trying to escape asciidoc (9.1.0) * with \ preserves the backslash in
> the formatted man page. Bare * works as expected.

Also applied, thanks.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-02-22 13:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-02-22 12:03 [nft PATCH 1/2] main: fix nft --help output fallout from 719e4427 Štěpán Němec
2021-02-22 12:03 ` [nft PATCH 2/2] doc: nft: fix some typos and formatting issues Štěpán Němec
2021-02-22 13:52   ` Pablo Neira Ayuso
2021-02-22 13:52 ` [nft PATCH 1/2] main: fix nft --help output fallout from 719e4427 Pablo Neira Ayuso

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).