diff options
author | Georg Brandl <georg@python.org> | 2009-10-22 15:54:35 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2009-10-22 15:54:35 (GMT) |
commit | d1bed8e5ef580567e2ba60c231a4716bc12e665d (patch) | |
tree | a6882b7aea4511cf0527a1ace22b00e2f2df2aa6 /Doc | |
parent | 76d6d4a01024056b75518ccf51f534ab89876e00 (diff) | |
download | cpython-d1bed8e5ef580567e2ba60c231a4716bc12e665d.zip cpython-d1bed8e5ef580567e2ba60c231a4716bc12e665d.tar.gz cpython-d1bed8e5ef580567e2ba60c231a4716bc12e665d.tar.bz2 |
#6977: getopt does not support optional option arguments.
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/getopt.rst | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/Doc/library/getopt.rst b/Doc/library/getopt.rst index 2c0fad9..927953c 100644 --- a/Doc/library/getopt.rst +++ b/Doc/library/getopt.rst @@ -30,19 +30,20 @@ exception: .. note:: - Unlike GNU :cfunc:`getopt`, after a non-option argument, all further arguments - are considered also non-options. This is similar to the way non-GNU Unix systems - work. + Unlike GNU :cfunc:`getopt`, after a non-option argument, all further + arguments are considered also non-options. This is similar to the way + non-GNU Unix systems work. *long_options*, 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, *options* 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 *long_options* 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. + 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 (``'='``). Optional + arguments are not supported. To accept only long options, *options* 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 *long_options* 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 |