33
Unlike GNU :cfunc:`getopt`, after a non-option argument, all further arguments
34
are considered also non-options. This is similar to the way non-GNU Unix systems
33
Unlike GNU :cfunc:`getopt`, after a non-option argument, all further
34
arguments are considered also non-options. This is similar to the way
35
non-GNU Unix systems work.
37
37
*long_options*, if specified, must be a list of strings with the names of the
38
long options which should be supported. The leading ``'-``\ ``-'`` characters
39
should not be included in the option name. Long options which require an
40
argument should be followed by an equal sign (``'='``). To accept only long
41
options, *options* should be an empty string. Long options on the command line
42
can be recognized so long as they provide a prefix of the option name that
43
matches exactly one of the accepted options. For example, if *long_options* is
44
``['foo', 'frob']``, the option :option:`--fo` will match as :option:`--foo`,
45
but :option:`--f` will not match uniquely, so :exc:`GetoptError` will be raised.
38
long options which should be supported. The leading ``'-``\ ``-'``
39
characters should not be included in the option name. Long options which
40
require an argument should be followed by an equal sign (``'='``). Optional
41
arguments are not supported. To accept only long options, *options* should
42
be an empty string. Long options on the command line can be recognized so
43
long as they provide a prefix of the option name that matches exactly one of
44
the accepted options. For example, if *long_options* is ``['foo', 'frob']``,
45
the option :option:`--fo` will match as :option:`--foo`, but :option:`--f`
46
will not match uniquely, so :exc:`GetoptError` will be raised.
47
48
The return value consists of two elements: the first is a list of ``(option,
48
49
value)`` pairs; the second is the list of program arguments left after the