Skip to content

Commit bc8af59

Browse files
[3.15] Document getopt and gnu_getopt longopts argument as string (GH-153976) (#154095)
Document getopt and gnu_getopt longopts argument as string (GH-153976) Document getopt and gnu_getopt longopts as string (cherry picked from commit 16562f1) Co-authored-by: Florian Freitag <flohacksfriday@gmail.com>
1 parent aa3b972 commit bc8af59

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

Doc/library/getopt.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ exception:
6262
option ``--fo`` will match as ``--foo``, but ``--f`` will
6363
not match uniquely, so :exc:`GetoptError` will be raised.
6464

65+
If *longopts* is a string it gets treated as a list of a single element.
66+
6567
The return value consists of two elements: the first is a list of ``(option,
6668
value)`` pairs; the second is the list of program arguments left after the
6769
option list was stripped (this is a trailing slice of *args*). Each

0 commit comments

Comments
 (0)