X-Git-Url: http://git.draconx.ca/gitweb/dxcommon.git/blobdiff_plain/6532aaac91a7efd99eb74726679c4000459e7bb3..bb43879990642c8b745a64597186207ab85ad05f:/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 {