diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/opt.c | 28 |
1 files changed, 13 insertions, 15 deletions
@@ -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) |