14
14
.. note ::
15
15
16
16
The :mod: `getopt ` module is a parser for command line options whose API is
17
- designed to be familiar to users of the C :c:func: `getopt ` function. Users who
18
- are unfamiliar with the C :c:func: `getopt ` function or who would like to write
17
+ designed to be familiar to users of the C :c:func: `! getopt ` function. Users who
18
+ are unfamiliar with the C :c:func: `! getopt ` function or who would like to write
19
19
less code and get better help and error messages should consider using the
20
20
:mod: `argparse ` module instead.
21
21
22
22
--------------
23
23
24
24
This module helps scripts to parse the command line arguments in ``sys.argv ``.
25
- It supports the same conventions as the Unix :c:func: `getopt ` function (including
25
+ It supports the same conventions as the Unix :c:func: `! getopt ` function (including
26
26
the special meanings of arguments of the form '``- ``' and '``-- ``'). Long
27
27
options similar to those supported by GNU software may be used as well via an
28
28
optional third argument.
@@ -37,11 +37,11 @@ exception:
37
37
be parsed, without the leading reference to the running program. Typically, this
38
38
means ``sys.argv[1:] ``. *shortopts * is the string of option letters that the
39
39
script wants to recognize, with options that require an argument followed by a
40
- colon (``':' ``; i.e., the same format that Unix :c:func: `getopt ` uses).
40
+ colon (``':' ``; i.e., the same format that Unix :c:func: `! getopt ` uses).
41
41
42
42
.. note ::
43
43
44
- Unlike GNU :c:func: `getopt `, after a non-option argument, all further
44
+ Unlike GNU :c:func: `! getopt `, after a non-option argument, all further
45
45
arguments are considered also non-options. This is similar to the way
46
46
non-GNU Unix systems work.
47
47
@@ -75,7 +75,7 @@ exception:
75
75
non-option argument is encountered.
76
76
77
77
If the first character of the option string is ``'+' ``, or if the environment
78
- variable :envvar: `POSIXLY_CORRECT ` is set, then option processing stops as
78
+ variable :envvar: `! POSIXLY_CORRECT ` is set, then option processing stops as
79
79
soon as a non-option argument is encountered.
80
80
81
81
@@ -85,9 +85,9 @@ exception:
85
85
an option requiring an argument is given none. The argument to the exception is
86
86
a string indicating the cause of the error. For long options, an argument given
87
87
to an option which does not require one will also cause this exception to be
88
- raised. The attributes :attr: `msg ` and :attr: `opt ` give the error message and
88
+ raised. The attributes :attr: `! msg ` and :attr: `! opt ` give the error message and
89
89
related option; if there is no specific option to which the exception relates,
90
- :attr: `opt ` is an empty string.
90
+ :attr: `! opt ` is an empty string.
91
91
92
92
.. XXX deprecated?
93
93
.. exception :: error
0 commit comments