Bruno Haible wrote:
I'm adding this as a Gnulib module now.
In general it looks good to me.
Just 2 details:
The use of 'countof' instead of terminating the array of 'struct
program_option' with an element containing all zeros may be an obstacle for
the adoption of this API outside Gnulib.
I found one apparent omission in lib/options.h:
--- lib/options.h~ 2025-06-26 19:31:53.000000000 +0200
+++ lib/options.h 2025-06-27 17:22:50.000000000 +0200
@@ -136,7 +136,7 @@
handle the option, and when the 'flag' is NULL, getopt_long returns
the value of 'val', as a way to identify which option was seen.
- It keeps the following properties the getopt_long() API:
+ It keeps the following properties of the getopt_long() API:
* The programmer writes in actions directly in the main() function.
That is, the actions don't go into separate callback functions
Best regards,
Antonio.