Thread (3 messages) 3 messages, 2 authors, 2025-12-07

[PATCH] man/man3/getopt.3: Assist getopt_long() users

From: G. Branden Robinson <hidden>
Date: 2025-12-07 14:46:08
Subsystem: the rest · Maintainer: Linus Torvalds

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.3 | 6 ++++++
 1 file changed, 6 insertions(+)
diff --git a/man/man3/getopt.3 b/man/man3/getopt.3
index 8495719af..432ea1252 100644
--- a/man/man3/getopt.3
+++ b/man/man3/getopt.3
@@ -300,6 +300,12 @@ .SS getopt_long() and getopt_long_only()
 points to a variable which is set to the index of the long option relative to
 .IR longopts .
 .P
+Its analogue to
+.BR getopt ()'s
+.I optopt
+is
+.RI \[lq] "argv[(optind \- 1)]" \[rq].
+.P
 .BR getopt_long_only ()
 is like
 .BR getopt_long (),
-- 
2.30.2

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