Skip to content

Commit b04adaf

Browse files
[3.13] Document getopt and gnu_getopt longopts argument as string (GH-153976) (#154097)
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 17b2a88 commit b04adaf

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
@@ -59,6 +59,8 @@ exception:
5959
option ``--fo`` will match as ``--foo``, but ``--f`` will
6060
not match uniquely, so :exc:`GetoptError` will be raised.
6161

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

0 commit comments

Comments
 (0)