Thread (5 messages) 5 messages, 2 authors, 2025-12-17

Re: [PATCH v2] man/man3/getopt_long.3: Assist users

From: Alejandro Colomar <alx@kernel.org>
Date: 2025-12-17 23:15:24

Hi Branden,

On Sat, Dec 13, 2025 at 07:37:54PM -0600, G. Branden Robinson wrote:
quoted hunk ↗ jump to hunk
Throw a bone to users of this function who need to report (in a
diagnostic message, for instance) the identity of an invalid long option
name.

Signed-off-by: "G. Branden Robinson" <redacted>
---
 man/man3/getopt_long.3 | 6 ++++++
 1 file changed, 6 insertions(+)
diff --git a/man/man3/getopt_long.3 b/man/man3/getopt_long.3
index 73e8f3e6f..a464349fe 100644
--- a/man/man3/getopt_long.3
+++ b/man/man3/getopt_long.3
@@ -102,6 +102,12 @@ .SH DESCRIPTION
 is not NULL, it
 points to a variable which is set to the index of the long option relative to
 .IR longopts .
+.P
+Its analogue to
+.BR getopt (3)'s
+.I optopt
+is
+.RI \[lq] "argv[(optind \- 1)]" \[rq].
Would you mind adding \% to the entire expression?


Have a lovely night!
Alex
 .SH RETURN VALUE
 See
 .BR getopt (3).
-- 
2.30.2


-- 
<https://www.alejandro-colomar.es>

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help