diff options
author | Štěpán Němec <snemec@redhat.com> | 2021-02-22 13:03:19 +0100 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2021-02-22 14:54:00 +0100 |
commit | b8c6dd1a9c0c6e937febc113e7ea89079aa945be (patch) | |
tree | b4b6d6b348d4a206cf07d9cd4dc3d2249bdb7e4c /src/main.c | |
parent | 267338ec392346ef55ed51509e5f8e8354d6c19a (diff) |
main: fix nft --help output fallout from 719e4427
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>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -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) |