summaryrefslogtreecommitdiff
path: root/src/opt.c
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2018-12-21 20:04:53 +0100
committerJörg Frings-Fürst <debian@jff-webhosting.net>2018-12-21 20:04:53 +0100
commit41aba5755c9fa6082aec99c4fec6c571f8e5062a (patch)
treeee8f99d7b3f87cffd163a2a994f8be5e49dd0cf2 /src/opt.c
parent91a64d5ccfd724eda5826b6f02704600a956e12e (diff)
parentb123453ef809983c17c1438410a13f799b42e5f9 (diff)
Merge branch 'release/debian/3.24-1'debian/3.24-1
Diffstat (limited to 'src/opt.c')
-rw-r--r--src/opt.c28
1 files changed, 13 insertions, 15 deletions
diff --git a/src/opt.c b/src/opt.c
index d64e521..8efbf52 100644
--- a/src/opt.c
+++ b/src/opt.c
@@ -304,22 +304,20 @@ static void opt_to_text(const struct HXoption *opt, char *buf, size_t len,
buf[i++] = opt->sh;
if (!takes_void(opt->type))
i += snprintf(buf + i, len - i, " %s", htyp);
+ } else if (opt->sh == '\0') {
+ if (takes_void(opt->type))
+ i += snprintf(buf + i, len - i,
+ "--%s", opt->ln);
+ else
+ i += snprintf(buf + i, len - i,
+ "--%s=%s", opt->ln, htyp);
} else {
- if (opt->sh == '\0') {
- if (takes_void(opt->type))
- i += snprintf(buf + i, len - i,
- "--%s", opt->ln);
- else
- i += snprintf(buf + i, len - i,
- "--%s=%s", opt->ln, htyp);
- } else {
- if (takes_void(opt->type))
- i += snprintf(buf + i, len - i, "-%c%s--%s",
- opt->sh, alt, opt->ln);
- else
- i += snprintf(buf + i, len - i, "-%c%s--%s%c%s",
- opt->sh, alt, opt->ln, equ, htyp);
- }
+ if (takes_void(opt->type))
+ i += snprintf(buf + i, len - i, "-%c%s--%s",
+ opt->sh, alt, opt->ln);
+ else
+ i += snprintf(buf + i, len - i, "-%c%s--%s%c%s",
+ opt->sh, alt, opt->ln, equ, htyp);
}
if (flags & W_BRACKET)