summaryrefslogtreecommitdiff
path: root/src/opt.c
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2018-11-18 13:52:53 +0100
committerJörg Frings-Fürst <debian@jff-webhosting.net>2018-11-18 13:52:53 +0100
commit9ab517d65bbe24869c2c449a52eb17f572d1ac8d (patch)
tree6cf2c7c9298da2de43f058988f14124c0734c10e /src/opt.c
parentd45dd31e35190cf08b1e716e7c3bd1468ddd5d88 (diff)
New upstream version 3.24upstream/3.24
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)