summaryrefslogtreecommitdiffstats
path: root/Doc/library/getopt.rst
diff options
context:
space:
mode:
Diffstat (limited to 'Doc/library/getopt.rst')
-rw-r--r--Doc/library/getopt.rst13
1 files changed, 7 insertions, 6 deletions
diff --git a/Doc/library/getopt.rst b/Doc/library/getopt.rst
index 7f6b670..a360384 100644
--- a/Doc/library/getopt.rst
+++ b/Doc/library/getopt.rst
@@ -36,12 +36,13 @@ exception:
*longopts*, if specified, must be a list of strings with the names of the
long options which should be supported. The leading ``'--'`` characters
should not be included in the option name. Long options which require an
- argument should be followed by an equal sign (``'='``). To accept only long
- options, *shortopts* should be an empty string. Long options on the command line
- can be recognized so long as they provide a prefix of the option name that
- matches exactly one of the accepted options. For example, if *longopts* is
- ``['foo', 'frob']``, the option :option:`--fo` will match as :option:`--foo`,
- but :option:`--f` will not match uniquely, so :exc:`GetoptError` will be raised.
+ argument should be followed by an equal sign (``'='``). Optional arguments
+ are not supported. To accept only long options, *shortopts* should be an
+ empty string. Long options on the command line can be recognized so long as
+ they provide a prefix of the option name that matches exactly one of the
+ accepted options. For example, if *longopts* is ``['foo', 'frob']``, the
+ option :option:`--fo` will match as :option:`--foo`, but :option:`--f` will
+ not match uniquely, so :exc:`GetoptError` will be raised.
The return value consists of two elements: the first is a list of ``(option,
value)`` pairs; the second is the list of program arguments left after the