@@ -82,14 +82,14 @@ \subsubsection{Terminology\label{optparse-terminology}}
8282a chunk of text that a user enters on the command-line, and that the
8383shell passes to \cfunction {execl()} or \cfunction {execv()}. In
8484Python, arguments are elements of
85- \var {sys.argv[1:]}. (\var {sys.argv[0]} is the name of the program
85+ \code {sys.argv[1:]}. (\code {sys.argv[0]} is the name of the program
8686being executed; in the context of parsing arguments, it's not very
8787important.) \UNIX {} shells also use the term `` word'' .
8888
8989It is occasionally desirable to use an argument list other than
90- \var {sys.argv[1:]}, so you should read `` argument'' as `` an element of
91- \var {sys.argv[1:]}, or of some other list provided as a substitute for
92- \var {sys.argv[1:]}'' .
90+ \code {sys.argv[1:]}, so you should read `` argument'' as `` an element of
91+ \code {sys.argv[1:]}, or of some other list provided as a substitute for
92+ \code {sys.argv[1:]}'' .
9393
9494\term {option}
9595 an argument used to supply extra information to guide or customize
@@ -306,10 +306,10 @@ \subsubsection{The \emph{store} action%
306306\end {verbatim }
307307
308308(Note that if you don't pass an argument list to
309- \function {parse_args()}, it automatically uses \var {sys.argv[1:]}.)
309+ \function {parse_args()}, it automatically uses \code {sys.argv[1:]}.)
310310
311311When \module {optparse} sees the \programopt {-f}, it consumes the next
312- argument---\code {foo.txt}---and stores it in the \var {filename}
312+ argument---\code {foo.txt}---and stores it in the \member {filename}
313313attribute of a special object. That object is the first return value
314314from \function {parse_args()}, so:
315315
@@ -354,9 +354,9 @@ \subsubsection{The \emph{store} action%
354354If you don't supply a destination, \module {optparse} figures out a
355355sensible default from the option strings: if the first long option
356356string is \longprogramopt {foo-bar}, then the default destination is
357- \var {foo_bar}. If there are no long option strings,
357+ \member {foo_bar}. If there are no long option strings,
358358\module {optparse} looks at the first short option: the default
359- destination for \programopt {-f} is \var {f}.
359+ destination for \programopt {-f} is \member {f}.
360360
361361Adding types is fairly easy; please refer to
362362section~\ref {optparse-adding-types }, `` Adding new types.''
@@ -380,8 +380,8 @@ \subsubsection{Other \emph{store_*} actions%
380380default values---see below.)
381381
382382When \module {optparse} sees \programopt {-v} on the command line, it sets
383- \var {options.verbose} to \code {True}; when it sees \programopt {-q}, it
384- sets \var {options.verbose} to \code {False}.
383+ \code {options.verbose} to \code {True}; when it sees \programopt {-q}, it
384+ sets \code {options.verbose} to \code {False}.
385385
386386\subsubsection {Setting default values\label {optparse-setting-default-values } }
387387
@@ -394,7 +394,7 @@ \subsubsection{Setting default values\label{optparse-setting-default-values}}
394394each destination, which is assigned before the command-line is parsed.
395395
396396First, consider the verbose/quiet example. If we want
397- \module {optparse} to set \var {verbose} to \code {True} unless
397+ \module {optparse} to set \member {verbose} to \code {True} unless
398398\programopt {-q} is seen, then we can do this:
399399
400400\begin {verbatim }
@@ -411,7 +411,7 @@ \subsubsection{Setting default values\label{optparse-setting-default-values}}
411411
412412Those are equivalent because you're supplying a default value for the
413413option's \emph {destination }, and these two options happen to have the same
414- destination (the \var {verbose} variable).
414+ destination (the \member {verbose} variable).
415415
416416Consider this:
417417
@@ -420,15 +420,15 @@ \subsubsection{Setting default values\label{optparse-setting-default-values}}
420420parser.add_option("-q", action="store_false", dest="verbose", default=True)
421421\end {verbatim }
422422
423- Again, the default value for \var {verbose} will be \code {True}: the last
423+ Again, the default value for \member {verbose} will be \code {True}: the last
424424default value supplied for any particular destination is the one that
425425counts.
426426
427427\subsubsection {Generating help\label {optparse-generating-help } }
428428
429429The last feature that you will use in every script is
430430\module {optparse}'s ability to generate help messages. All you have
431- to do is supply a \var {help} value when you add an option. Let's
431+ to do is supply a \var {help} argument when you add an option. Let's
432432create a new parser and populate it with user-friendly (documented)
433433options:
434434
@@ -738,7 +738,7 @@ \subsubsection{Defining options\label{optparse-defining-options}}
738738\end {verbatim }
739739
740740one of the first things \module {optparse} does is create a
741- \var {values} object:
741+ \code {values} object:
742742
743743\begin {verbatim }
744744values = Values()
@@ -786,7 +786,7 @@ \subsubsection{Option actions\label{optparse-option-actions}}
786786\code {nargs > 1}, multiple arguments will be consumed from the command
787787line; all will be converted according to \var {type} and stored to
788788\var {dest} as a tuple. See section~\ref {optparse-option-types },
789- `` Option types'' below.
789+ `` Option types, '' below.
790790
791791If \var {choices} (a sequence of strings) is supplied, the type
792792defaults to `` choice'' .
@@ -795,9 +795,9 @@ \subsubsection{Option actions\label{optparse-option-actions}}
795795
796796If \var {dest} is not supplied, \module {optparse} derives a
797797destination from the first long option strings (e.g.,
798- \longprogramopt {foo-bar} becomes \var {foo_bar}). If there are no long
798+ \longprogramopt {foo-bar} becomes \member {foo_bar}). If there are no long
799799option strings, \module {optparse} derives a destination from the first
800- short option string (e.g., \programopt {-f} becomes \var {f}).
800+ short option string (e.g., \programopt {-f} becomes \member {f}).
801801
802802Example:
803803
@@ -1217,7 +1217,7 @@ \subsubsection{How callbacks are called\label{optparse-callbacks-called}}
12171217\term {opt}
12181218is the option string seen on the command-line that's triggering the
12191219callback. (If an abbreviated long option was used, \var {opt} will be
1220- the full, canonical option string---e.g. if the user puts
1220+ the full, canonical option string---for example, if the user puts
12211221\longprogramopt {foo} on the command-line as an abbreviation for
12221222\longprogramopt {foobar}, then \var {opt} will be
12231223\longprogramopt {foobar}.)
@@ -1676,7 +1676,7 @@ \subsubsection{Other reasons to extend \module{optparse}\label{optparse-extendin
16761676The second, much more complex, possibility is to override the
16771677command-line syntax implemented by \module {optparse}. In this case,
16781678you'd leave the whole machinery of option actions and types alone, but
1679- rewrite the code that processes \var {sys.argv}. You'll need to
1679+ rewrite the code that processes \code {sys.argv}. You'll need to
16801680subclass \class {OptionParser} in any case; depending on how radical a
16811681rewrite you want, you'll probably need to override one or all of
16821682\method {parse_args()}, \method {_process_long_opt()}, and
0 commit comments