X-Git-Url: http://git.draconx.ca/gitweb/dxcommon.git/blobdiff_plain/5d7b80ce6f21d6d90ecec188f135e665d789dede..03a26752c80546ac8cf8fc81807bb5a153786599:/src/help.c diff --git a/src/help.c b/src/help.c index ea817e8..43bb266 100644 --- a/src/help.c +++ b/src/help.c @@ -1,5 +1,5 @@ /* - * Copyright © 2021 Nick Bowler + * Copyright © 2021-2022 Nick Bowler * * Helper functions for formatting --help program output. * @@ -51,7 +51,12 @@ */ static int option_type(const struct option *opt) { - return ((opt->val <= CHAR_MAX) << 2) | (opt->has_arg & 3); + int ret = opt->has_arg & 3; + + if (!opt->flag) + ret |= (opt->val <= CHAR_MAX) << 2; + + return ret; } enum {