From b8c6dd1a9c0c6e937febc113e7ea89079aa945be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0t=C4=9Bp=C3=A1n=20N=C4=9Bmec?= Date: Mon, 22 Feb 2021 13:03:19 +0100 Subject: main: fix nft --help output fallout from 719e4427 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Štěpán Němec Signed-off-by: Pablo Neira Ayuso --- src/main.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index 80cf1acf..8c470644 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) -- cgit v1.2.3