|
From: | Shawn Wagner |
Subject: | Re: "CHAR_MIN - X" in help/version flags |
Date: | Fri, 5 Aug 2022 23:13:23 -0700 |
I had a hunch it must be something like that, but was afraid it was a misunderstanding. Thanks for the clear explanation! It sounds like we should be okay to go ahead with implementing an awk-like -h/-V.
Hey Shawn,
>They're not listed in the short options passed to getopt_long(), hence the
>error. But ~ isn't actually what CHAR_MIN - 2 is; it's just what you get
>when you convert an int outside of the range of chars to a char. Those
>values are ints that can't be represented in a char type, meaning they
>can't go in the short options so they're ideal for a long-only option to
>avoid any chance of future conflicts - only so many single character
>options available to use. If you want to make -h a synonym for --help,
>you'd have to add it to the short options and change the --help entry in
>the long options to return 'h', and adjust the argument-handling switch too.
I had a hunch it must be something like that, but was afraid it was a misunderstanding. Thanks for the clear explanation! It sounds like we should be okay to go ahead with implementing an awk-like -h/-V.
~ Tim
[Prev in Thread] | Current Thread | [Next in Thread] |