/*
- * Copyright © 2021 Nick Bowler
+ * Copyright © 2021-2022 Nick Bowler
*
* Helper functions for formatting --help program output.
*
#endif
#if ENABLE_NLS
+# include <locale.h>
# include <gettext.h>
# include <mbswidth.h>
#else
*/
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 {