|
|
168a1c |
From 5f91359f1bbcd73346e4469f0b5a30e04f107a06 Mon Sep 17 00:00:00 2001
|
|
|
168a1c |
From: =?UTF-8?q?=C5=A0t=C4=9Bp=C3=A1n=20N=C4=9Bmec?= <snemec@redhat.com>
|
|
|
168a1c |
Date: Mon, 22 Feb 2021 13:03:19 +0100
|
|
|
168a1c |
Subject: [PATCH] main: fix nft --help output fallout from 719e4427
|
|
|
168a1c |
MIME-Version: 1.0
|
|
|
168a1c |
Content-Type: text/plain; charset=UTF-8
|
|
|
168a1c |
Content-Transfer-Encoding: 8bit
|
|
|
168a1c |
|
|
|
168a1c |
Long options were missing the double dash.
|
|
|
168a1c |
|
|
|
168a1c |
Fixes: 719e44277f8e ("main: use one data-structure to initialize getopt_long(3) arguments and help.")
|
|
|
168a1c |
Cc: Jeremy Sowden <jeremy@azazel.net>
|
|
|
168a1c |
Signed-off-by: Štěpán Němec <snemec@redhat.com>
|
|
|
168a1c |
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
|
|
|
168a1c |
(cherry picked from commit b8c6dd1a9c0c6e937febc113e7ea89079aa945be)
|
|
|
168a1c |
Signed-off-by: Phil Sutter <psutter@redhat.com>
|
|
|
168a1c |
---
|
|
|
168a1c |
src/main.c | 7 ++++---
|
|
|
168a1c |
1 file changed, 4 insertions(+), 3 deletions(-)
|
|
|
168a1c |
|
|
|
168a1c |
diff --git a/src/main.c b/src/main.c
|
|
|
168a1c |
index 80cf1acf0f7f4..8c47064459ecb 100644
|
|
|
168a1c |
--- a/src/main.c
|
|
|
168a1c |
+++ b/src/main.c
|
|
|
168a1c |
@@ -175,16 +175,17 @@ static const struct option *get_options(void)
|
|
|
168a1c |
|
|
|
168a1c |
static void print_option(const struct nft_opt *opt)
|
|
|
168a1c |
{
|
|
|
168a1c |
- char optbuf[33] = "";
|
|
|
168a1c |
+ char optbuf[35] = "";
|
|
|
168a1c |
int i;
|
|
|
168a1c |
|
|
|
168a1c |
i = snprintf(optbuf, sizeof(optbuf), " -%c", opt->val);
|
|
|
168a1c |
if (opt->name)
|
|
|
168a1c |
- i += snprintf(optbuf + i, sizeof(optbuf) - i, ", %s", opt->name);
|
|
|
168a1c |
+ i += snprintf(optbuf + i, sizeof(optbuf) - i, ", --%s",
|
|
|
168a1c |
+ opt->name);
|
|
|
168a1c |
if (opt->arg)
|
|
|
168a1c |
i += snprintf(optbuf + i, sizeof(optbuf) - i, " %s", opt->arg);
|
|
|
168a1c |
|
|
|
168a1c |
- printf("%-32s%s\n", optbuf, opt->help);
|
|
|
168a1c |
+ printf("%-34s%s\n", optbuf, opt->help);
|
|
|
168a1c |
}
|
|
|
168a1c |
|
|
|
168a1c |
static void show_help(const char *name)
|
|
|
168a1c |
--
|
|
|
168a1c |
2.31.1
|
|
|
168a1c |
|