1
0
Fork 0
python-docs-fr/library/argparse.po

1748 lines
60 KiB
Plaintext
Raw Normal View History

2018-07-04 09:06:45 +00:00
# Copyright (C) 2001-2018, Python Software Foundation
2018-07-04 09:08:42 +00:00
# For licence information, see README file.
2016-10-30 09:46:26 +00:00
#
msgid ""
msgstr ""
"Project-Id-Version: Python 3.6\n"
"Report-Msgid-Bugs-To: \n"
2018-06-28 13:32:56 +00:00
"POT-Creation-Date: 2018-06-28 15:29+0200\n"
2018-07-21 08:59:44 +00:00
"PO-Revision-Date: 2018-07-04 11:36+0200\n"
2016-10-30 09:46:26 +00:00
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
2018-07-04 09:14:25 +00:00
"Language-Team: FRENCH <traductions@lists.afpy.org>\n"
2017-05-23 22:40:56 +00:00
"Language: fr\n"
2016-10-30 09:46:26 +00:00
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: ../Doc/library/argparse.rst:2
msgid ""
":mod:`argparse` --- Parser for command-line options, arguments and sub-"
"commands"
msgstr ""
2017-08-30 11:28:19 +00:00
":mod:`argparse` -- Parseur d'arguments, d'options, et de sous-commandes de "
"ligne de commande"
2016-10-30 09:46:26 +00:00
#: ../Doc/library/argparse.rst:12
msgid "**Source code:** :source:`Lib/argparse.py`"
msgstr "**Code source:** :source:`Lib/argparse.py`"
2018-06-10 09:32:30 +00:00
#: ../Doc/library/argparse.rst:None
msgid "Tutorial"
msgstr "Tutoriel"
2016-10-30 09:46:26 +00:00
#: ../Doc/library/argparse.rst:18
msgid ""
"This page contains the API reference information. For a more gentle "
"introduction to Python command-line parsing, have a look at the :ref:"
"`argparse tutorial <argparse-tutorial>`."
msgstr ""
2017-08-30 11:28:19 +00:00
"Cette page est la référence de l'API. Pour une introduction plus en douceur "
2017-09-24 21:19:43 +00:00
"à l'analyse des arguments de la ligne de commande, regardez :ref:`le "
"tutoriel argparse <argparse-tutorial>`."
2016-10-30 09:46:26 +00:00
#: ../Doc/library/argparse.rst:22
msgid ""
"The :mod:`argparse` module makes it easy to write user-friendly command-line "
"interfaces. The program defines what arguments it requires, and :mod:"
"`argparse` will figure out how to parse those out of :data:`sys.argv`. The :"
"mod:`argparse` module also automatically generates help and usage messages "
"and issues errors when users give the program invalid arguments."
msgstr ""
#: ../Doc/library/argparse.rst:30
msgid "Example"
msgstr "Exemple"
#: ../Doc/library/argparse.rst:32
msgid ""
"The following code is a Python program that takes a list of integers and "
"produces either the sum or the max::"
msgstr ""
2017-08-30 11:28:19 +00:00
"Le code suivant est un programme Python acceptant une liste de nombre "
"entiers et en donnant soit la somme, soit le maximum ::"
2016-10-30 09:46:26 +00:00
#: ../Doc/library/argparse.rst:47
msgid ""
"Assuming the Python code above is saved into a file called ``prog.py``, it "
"can be run at the command line and provides useful help messages:"
msgstr ""
#: ../Doc/library/argparse.rst:64
msgid ""
"When run with the appropriate arguments, it prints either the sum or the max "
"of the command-line integers:"
msgstr ""
#: ../Doc/library/argparse.rst:75
msgid "If invalid arguments are passed in, it will issue an error:"
msgstr ""
#: ../Doc/library/argparse.rst:83
msgid "The following sections walk you through this example."
msgstr ""
#: ../Doc/library/argparse.rst:87
msgid "Creating a parser"
msgstr "Créer un parseur"
#: ../Doc/library/argparse.rst:89
msgid ""
"The first step in using the :mod:`argparse` is creating an :class:"
"`ArgumentParser` object::"
msgstr ""
#: ../Doc/library/argparse.rst:94
msgid ""
"The :class:`ArgumentParser` object will hold all the information necessary "
"to parse the command line into Python data types."
msgstr ""
#: ../Doc/library/argparse.rst:99
msgid "Adding arguments"
msgstr "Ajouter des arguments"
#: ../Doc/library/argparse.rst:101
msgid ""
"Filling an :class:`ArgumentParser` with information about program arguments "
"is done by making calls to the :meth:`~ArgumentParser.add_argument` method. "
"Generally, these calls tell the :class:`ArgumentParser` how to take the "
"strings on the command line and turn them into objects. This information is "
"stored and used when :meth:`~ArgumentParser.parse_args` is called. For "
"example::"
msgstr ""
#: ../Doc/library/argparse.rst:113
msgid ""
"Later, calling :meth:`~ArgumentParser.parse_args` will return an object with "
"two attributes, ``integers`` and ``accumulate``. The ``integers`` attribute "
"will be a list of one or more ints, and the ``accumulate`` attribute will be "
"either the :func:`sum` function, if ``--sum`` was specified at the command "
"line, or the :func:`max` function if it was not."
msgstr ""
#: ../Doc/library/argparse.rst:121
msgid "Parsing arguments"
msgstr "Analyse des arguments"
#: ../Doc/library/argparse.rst:123
msgid ""
":class:`ArgumentParser` parses arguments through the :meth:`~ArgumentParser."
"parse_args` method. This will inspect the command line, convert each "
"argument to the appropriate type and then invoke the appropriate action. In "
"most cases, this means a simple :class:`Namespace` object will be built up "
"from attributes parsed out of the command line::"
msgstr ""
#: ../Doc/library/argparse.rst:132
msgid ""
"In a script, :meth:`~ArgumentParser.parse_args` will typically be called "
"with no arguments, and the :class:`ArgumentParser` will automatically "
"determine the command-line arguments from :data:`sys.argv`."
msgstr ""
#: ../Doc/library/argparse.rst:138
msgid "ArgumentParser objects"
msgstr "Objets ArgumentParser"
#: ../Doc/library/argparse.rst:147
msgid ""
"Create a new :class:`ArgumentParser` object. All parameters should be passed "
"as keyword arguments. Each parameter has its own more detailed description "
"below, but in short they are:"
msgstr ""
#: ../Doc/library/argparse.rst:151
msgid "prog_ - The name of the program (default: ``sys.argv[0]``)"
msgstr ""
#: ../Doc/library/argparse.rst:153
msgid ""
"usage_ - The string describing the program usage (default: generated from "
"arguments added to parser)"
msgstr ""
#: ../Doc/library/argparse.rst:156
msgid "description_ - Text to display before the argument help (default: none)"
msgstr ""
#: ../Doc/library/argparse.rst:158
msgid "epilog_ - Text to display after the argument help (default: none)"
msgstr ""
#: ../Doc/library/argparse.rst:160
msgid ""
"parents_ - A list of :class:`ArgumentParser` objects whose arguments should "
"also be included"
msgstr ""
#: ../Doc/library/argparse.rst:163
msgid "formatter_class_ - A class for customizing the help output"
msgstr ""
#: ../Doc/library/argparse.rst:165
msgid ""
"prefix_chars_ - The set of characters that prefix optional arguments "
"(default: '-')"
msgstr ""
#: ../Doc/library/argparse.rst:168
msgid ""
"fromfile_prefix_chars_ - The set of characters that prefix files from which "
"additional arguments should be read (default: ``None``)"
msgstr ""
#: ../Doc/library/argparse.rst:171
msgid ""
"argument_default_ - The global default value for arguments (default: "
"``None``)"
msgstr ""
#: ../Doc/library/argparse.rst:174
msgid ""
"conflict_handler_ - The strategy for resolving conflicting optionals "
"(usually unnecessary)"
msgstr ""
#: ../Doc/library/argparse.rst:177
2017-04-02 20:14:06 +00:00
msgid ""
"add_help_ - Add a ``-h/--help`` option to the parser (default: ``True``)"
2016-10-30 09:46:26 +00:00
msgstr ""
#: ../Doc/library/argparse.rst:179
msgid ""
"allow_abbrev_ - Allows long options to be abbreviated if the abbreviation is "
"unambiguous. (default: ``True``)"
msgstr ""
#: ../Doc/library/argparse.rst:182
msgid "*allow_abbrev* parameter was added."
msgstr "Le paramètre *allow_abbrev* est ajouté."
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:185 ../Doc/library/argparse.rst:683
2016-10-30 09:46:26 +00:00
msgid "The following sections describe how each of these are used."
msgstr ""
#: ../Doc/library/argparse.rst:189
msgid "prog"
msgstr "prog"
#: ../Doc/library/argparse.rst:191
msgid ""
"By default, :class:`ArgumentParser` objects use ``sys.argv[0]`` to determine "
"how to display the name of the program in help messages. This default is "
"almost always desirable because it will make the help messages match how the "
"program was invoked on the command line. For example, consider a file named "
"``myprogram.py`` with the following code::"
msgstr ""
#: ../Doc/library/argparse.rst:202
msgid ""
"The help for this program will display ``myprogram.py`` as the program name "
"(regardless of where the program was invoked from):"
msgstr ""
#: ../Doc/library/argparse.rst:221
msgid ""
"To change this default behavior, another value can be supplied using the "
"``prog=`` argument to :class:`ArgumentParser`::"
msgstr ""
#: ../Doc/library/argparse.rst:231
msgid ""
"Note that the program name, whether determined from ``sys.argv[0]`` or from "
"the ``prog=`` argument, is available to help messages using the ``%(prog)s`` "
"format specifier."
msgstr ""
#: ../Doc/library/argparse.rst:248
msgid "usage"
msgstr "usage"
#: ../Doc/library/argparse.rst:250
msgid ""
"By default, :class:`ArgumentParser` calculates the usage message from the "
"arguments it contains::"
msgstr ""
#: ../Doc/library/argparse.rst:266
msgid ""
"The default message can be overridden with the ``usage=`` keyword argument::"
msgstr ""
#: ../Doc/library/argparse.rst:281
msgid ""
"The ``%(prog)s`` format specifier is available to fill in the program name "
"in your usage messages."
msgstr ""
#: ../Doc/library/argparse.rst:286
msgid "description"
msgstr "description"
#: ../Doc/library/argparse.rst:288
msgid ""
"Most calls to the :class:`ArgumentParser` constructor will use the "
"``description=`` keyword argument. This argument gives a brief description "
"of what the program does and how it works. In help messages, the "
"description is displayed between the command-line usage string and the help "
"messages for the various arguments::"
msgstr ""
#: ../Doc/library/argparse.rst:303
msgid ""
"By default, the description will be line-wrapped so that it fits within the "
"given space. To change this behavior, see the formatter_class_ argument."
msgstr ""
#: ../Doc/library/argparse.rst:308
msgid "epilog"
msgstr "epilog"
#: ../Doc/library/argparse.rst:310
msgid ""
"Some programs like to display additional description of the program after "
"the description of the arguments. Such text can be specified using the "
"``epilog=`` argument to :class:`ArgumentParser`::"
msgstr ""
#: ../Doc/library/argparse.rst:327
msgid ""
"As with the description_ argument, the ``epilog=`` text is by default line-"
"wrapped, but this behavior can be adjusted with the formatter_class_ "
"argument to :class:`ArgumentParser`."
msgstr ""
#: ../Doc/library/argparse.rst:333
msgid "parents"
msgstr "parents"
#: ../Doc/library/argparse.rst:335
msgid ""
"Sometimes, several parsers share a common set of arguments. Rather than "
"repeating the definitions of these arguments, a single parser with all the "
"shared arguments and passed to ``parents=`` argument to :class:"
"`ArgumentParser` can be used. The ``parents=`` argument takes a list of :"
"class:`ArgumentParser` objects, collects all the positional and optional "
"actions from them, and adds these actions to the :class:`ArgumentParser` "
"object being constructed::"
msgstr ""
#: ../Doc/library/argparse.rst:355
msgid ""
"Note that most parent parsers will specify ``add_help=False``. Otherwise, "
"the :class:`ArgumentParser` will see two ``-h/--help`` options (one in the "
"parent and one in the child) and raise an error."
msgstr ""
#: ../Doc/library/argparse.rst:360
msgid ""
"You must fully initialize the parsers before passing them via ``parents=``. "
"If you change the parent parsers after the child parser, those changes will "
"not be reflected in the child."
msgstr ""
#: ../Doc/library/argparse.rst:366
msgid "formatter_class"
2017-08-30 11:28:19 +00:00
msgstr "formatter_class"
2016-10-30 09:46:26 +00:00
#: ../Doc/library/argparse.rst:368
msgid ""
":class:`ArgumentParser` objects allow the help formatting to be customized "
"by specifying an alternate formatting class. Currently, there are four such "
"classes:"
msgstr ""
#: ../Doc/library/argparse.rst:377
msgid ""
":class:`RawDescriptionHelpFormatter` and :class:`RawTextHelpFormatter` give "
"more control over how textual descriptions are displayed. By default, :class:"
"`ArgumentParser` objects line-wrap the description_ and epilog_ texts in "
"command-line help messages::"
msgstr ""
#: ../Doc/library/argparse.rst:402
msgid ""
"Passing :class:`RawDescriptionHelpFormatter` as ``formatter_class=`` "
"indicates that description_ and epilog_ are already correctly formatted and "
"should not be line-wrapped::"
msgstr ""
#: ../Doc/library/argparse.rst:428
msgid ""
":class:`RawTextHelpFormatter` maintains whitespace for all sorts of help "
2017-09-12 11:40:22 +00:00
"text, including argument descriptions. However, multiple new lines are "
"replaced with one. If you wish to preserve multiple blank lines, add spaces "
"between the newlines."
2016-10-30 09:46:26 +00:00
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:433
2016-10-30 09:46:26 +00:00
msgid ""
":class:`ArgumentDefaultsHelpFormatter` automatically adds information about "
"default values to each of the argument help messages::"
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:451
2016-10-30 09:46:26 +00:00
msgid ""
":class:`MetavarTypeHelpFormatter` uses the name of the type_ argument for "
"each argument as the display name for its values (rather than using the "
"dest_ as the regular formatter does)::"
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:472
2016-10-30 09:46:26 +00:00
msgid "prefix_chars"
msgstr "préfixe_chars"
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:474
2016-10-30 09:46:26 +00:00
msgid ""
"Most command-line options will use ``-`` as the prefix, e.g. ``-f/--foo``. "
"Parsers that need to support different or additional prefix characters, e.g. "
"for options like ``+f`` or ``/foo``, may specify them using the "
"``prefix_chars=`` argument to the ArgumentParser constructor::"
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:486
2016-10-30 09:46:26 +00:00
msgid ""
"The ``prefix_chars=`` argument defaults to ``'-'``. Supplying a set of "
"characters that does not include ``-`` will cause ``-f/--foo`` options to be "
"disallowed."
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:492
2016-10-30 09:46:26 +00:00
msgid "fromfile_prefix_chars"
msgstr "fromfile_préfixe_chars"
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:494
2016-10-30 09:46:26 +00:00
msgid ""
"Sometimes, for example when dealing with a particularly long argument lists, "
"it may make sense to keep the list of arguments in a file rather than typing "
"it out at the command line. If the ``fromfile_prefix_chars=`` argument is "
"given to the :class:`ArgumentParser` constructor, then arguments that start "
"with any of the specified characters will be treated as files, and will be "
"replaced by the arguments they contain. For example::"
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:508
2016-10-30 09:46:26 +00:00
msgid ""
"Arguments read from a file must by default be one per line (but see also :"
"meth:`~ArgumentParser.convert_arg_line_to_args`) and are treated as if they "
"were in the same place as the original file referencing argument on the "
"command line. So in the example above, the expression ``['-f', 'foo', "
"'@args.txt']`` is considered equivalent to the expression ``['-f', 'foo', '-"
"f', 'bar']``."
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:514
2016-10-30 09:46:26 +00:00
msgid ""
"The ``fromfile_prefix_chars=`` argument defaults to ``None``, meaning that "
"arguments will never be treated as file references."
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:519
2016-10-30 09:46:26 +00:00
msgid "argument_default"
msgstr "argument_default"
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:521
2016-10-30 09:46:26 +00:00
msgid ""
"Generally, argument defaults are specified either by passing a default to :"
"meth:`~ArgumentParser.add_argument` or by calling the :meth:`~ArgumentParser."
"set_defaults` methods with a specific set of name-value pairs. Sometimes "
"however, it may be useful to specify a single parser-wide default for "
"arguments. This can be accomplished by passing the ``argument_default=`` "
"keyword argument to :class:`ArgumentParser`. For example, to globally "
"suppress attribute creation on :meth:`~ArgumentParser.parse_args` calls, we "
"supply ``argument_default=SUPPRESS``::"
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:541
2016-10-30 09:46:26 +00:00
msgid "allow_abbrev"
msgstr "allow_abbrev"
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:543
2016-10-30 09:46:26 +00:00
msgid ""
"Normally, when you pass an argument list to the :meth:`~ArgumentParser."
"parse_args` method of an :class:`ArgumentParser`, it :ref:`recognizes "
"abbreviations <prefix-matching>` of long options."
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:547
2016-10-30 09:46:26 +00:00
msgid "This feature can be disabled by setting ``allow_abbrev`` to ``False``::"
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:560
2016-10-30 09:46:26 +00:00
msgid "conflict_handler"
msgstr "conflict_handler"
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:562
2016-10-30 09:46:26 +00:00
msgid ""
":class:`ArgumentParser` objects do not allow two actions with the same "
"option string. By default, :class:`ArgumentParser` objects raise an "
"exception if an attempt is made to create an argument with an option string "
"that is already in use::"
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:574
2016-10-30 09:46:26 +00:00
msgid ""
"Sometimes (e.g. when using parents_) it may be useful to simply override any "
"older arguments with the same option string. To get this behavior, the "
"value ``'resolve'`` can be supplied to the ``conflict_handler=`` argument "
"of :class:`ArgumentParser`::"
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:590
2016-10-30 09:46:26 +00:00
msgid ""
"Note that :class:`ArgumentParser` objects only remove an action if all of "
"its option strings are overridden. So, in the example above, the old ``-f/--"
"foo`` action is retained as the ``-f`` action, because only the ``--foo`` "
"option string was overridden."
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:597
2016-10-30 09:46:26 +00:00
msgid "add_help"
msgstr "add_help"
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:599
2016-10-30 09:46:26 +00:00
msgid ""
"By default, ArgumentParser objects add an option which simply displays the "
"parser's help message. For example, consider a file named ``myprogram.py`` "
"containing the following code::"
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:608
2016-10-30 09:46:26 +00:00
msgid ""
"If ``-h`` or ``--help`` is supplied at the command line, the ArgumentParser "
"help will be printed:"
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:620
2016-10-30 09:46:26 +00:00
msgid ""
"Occasionally, it may be useful to disable the addition of this help option. "
"This can be achieved by passing ``False`` as the ``add_help=`` argument to :"
"class:`ArgumentParser`::"
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:632
2016-10-30 09:46:26 +00:00
msgid ""
"The help option is typically ``-h/--help``. The exception to this is if the "
"``prefix_chars=`` is specified and does not include ``-``, in which case ``-"
"h`` and ``--help`` are not valid options. In this case, the first character "
"in ``prefix_chars`` is used to prefix the help options::"
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:647
2016-10-30 09:46:26 +00:00
msgid "The add_argument() method"
msgstr "La méthode add_argument()"
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:653
2016-10-30 09:46:26 +00:00
msgid ""
"Define how a single command-line argument should be parsed. Each parameter "
"has its own more detailed description below, but in short they are:"
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:656
2016-10-30 09:46:26 +00:00
msgid ""
"`name or flags`_ - Either a name or a list of option strings, e.g. ``foo`` "
"or ``-f, --foo``."
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:659
2016-10-30 09:46:26 +00:00
msgid ""
"action_ - The basic type of action to be taken when this argument is "
"encountered at the command line."
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:662
2016-10-30 09:46:26 +00:00
msgid "nargs_ - The number of command-line arguments that should be consumed."
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:664
2016-10-30 09:46:26 +00:00
msgid ""
"const_ - A constant value required by some action_ and nargs_ selections."
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:666
2016-10-30 09:46:26 +00:00
msgid ""
"default_ - The value produced if the argument is absent from the command "
"line."
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:669
2016-10-30 09:46:26 +00:00
msgid ""
"type_ - The type to which the command-line argument should be converted."
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:671
2016-10-30 09:46:26 +00:00
msgid "choices_ - A container of the allowable values for the argument."
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:673
2016-10-30 09:46:26 +00:00
msgid ""
"required_ - Whether or not the command-line option may be omitted (optionals "
"only)."
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:676
2016-10-30 09:46:26 +00:00
msgid "help_ - A brief description of what the argument does."
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:678
2016-10-30 09:46:26 +00:00
msgid "metavar_ - A name for the argument in usage messages."
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:680
2016-10-30 09:46:26 +00:00
msgid ""
"dest_ - The name of the attribute to be added to the object returned by :"
"meth:`parse_args`."
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:687
2016-10-30 09:46:26 +00:00
msgid "name or flags"
msgstr "nom ou option"
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:689
2016-10-30 09:46:26 +00:00
msgid ""
"The :meth:`~ArgumentParser.add_argument` method must know whether an "
"optional argument, like ``-f`` or ``--foo``, or a positional argument, like "
"a list of filenames, is expected. The first arguments passed to :meth:"
"`~ArgumentParser.add_argument` must therefore be either a series of flags, "
"or a simple argument name. For example, an optional argument could be "
"created like::"
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:698
2016-10-30 09:46:26 +00:00
msgid "while a positional argument could be created like::"
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:702
2016-10-30 09:46:26 +00:00
msgid ""
"When :meth:`~ArgumentParser.parse_args` is called, optional arguments will "
"be identified by the ``-`` prefix, and the remaining arguments will be "
"assumed to be positional::"
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:719
2016-10-30 09:46:26 +00:00
msgid "action"
msgstr "action"
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:721
2016-10-30 09:46:26 +00:00
msgid ""
":class:`ArgumentParser` objects associate command-line arguments with "
"actions. These actions can do just about anything with the command-line "
"arguments associated with them, though most actions simply add an attribute "
"to the object returned by :meth:`~ArgumentParser.parse_args`. The "
"``action`` keyword argument specifies how the command-line arguments should "
"be handled. The supplied actions are:"
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:727
2016-10-30 09:46:26 +00:00
msgid ""
"``'store'`` - This just stores the argument's value. This is the default "
"action. For example::"
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:735
2016-10-30 09:46:26 +00:00
msgid ""
"``'store_const'`` - This stores the value specified by the const_ keyword "
"argument. The ``'store_const'`` action is most commonly used with optional "
"arguments that specify some sort of flag. For example::"
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:744
2016-10-30 09:46:26 +00:00
msgid ""
"``'store_true'`` and ``'store_false'`` - These are special cases of "
"``'store_const'`` used for storing the values ``True`` and ``False`` "
"respectively. In addition, they create default values of ``False`` and "
"``True`` respectively. For example::"
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:756
2016-10-30 09:46:26 +00:00
msgid ""
"``'append'`` - This stores a list, and appends each argument value to the "
"list. This is useful to allow an option to be specified multiple times. "
"Example usage::"
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:765
2016-10-30 09:46:26 +00:00
msgid ""
"``'append_const'`` - This stores a list, and appends the value specified by "
"the const_ keyword argument to the list. (Note that the const_ keyword "
"argument defaults to ``None``.) The ``'append_const'`` action is typically "
"useful when multiple arguments need to store constants to the same list. For "
"example::"
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:777
2016-10-30 09:46:26 +00:00
msgid ""
"``'count'`` - This counts the number of times a keyword argument occurs. For "
"example, this is useful for increasing verbosity levels::"
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:785
2016-10-30 09:46:26 +00:00
msgid ""
"``'help'`` - This prints a complete help message for all the options in the "
"current parser and then exits. By default a help action is automatically "
"added to the parser. See :class:`ArgumentParser` for details of how the "
"output is created."
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:790
2016-10-30 09:46:26 +00:00
msgid ""
"``'version'`` - This expects a ``version=`` keyword argument in the :meth:"
"`~ArgumentParser.add_argument` call, and prints version information and "
"exits when invoked::"
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:800
2016-10-30 09:46:26 +00:00
msgid ""
"You may also specify an arbitrary action by passing an Action subclass or "
"other object that implements the same interface. The recommended way to do "
"this is to extend :class:`Action`, overriding the ``__call__`` method and "
"optionally the ``__init__`` method."
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:805
2016-10-30 09:46:26 +00:00
msgid "An example of a custom action::"
msgstr "Un exemple d'action personnalisée : ::"
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:825
2016-10-30 09:46:26 +00:00
msgid "For more details, see :class:`Action`."
msgstr "Pour plus d'information, voir :class:`Action`."
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:828
2016-10-30 09:46:26 +00:00
msgid "nargs"
msgstr "nargs"
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:830
2016-10-30 09:46:26 +00:00
msgid ""
"ArgumentParser objects usually associate a single command-line argument with "
"a single action to be taken. The ``nargs`` keyword argument associates a "
"different number of command-line arguments with a single action. The "
"supported values are:"
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:835
2016-10-30 09:46:26 +00:00
msgid ""
"``N`` (an integer). ``N`` arguments from the command line will be gathered "
"together into a list. For example::"
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:844
2016-10-30 09:46:26 +00:00
msgid ""
"Note that ``nargs=1`` produces a list of one item. This is different from "
"the default, in which the item is produced by itself."
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:847
2016-10-30 09:46:26 +00:00
msgid ""
"``'?'``. One argument will be consumed from the command line if possible, "
"and produced as a single item. If no command-line argument is present, the "
"value from default_ will be produced. Note that for optional arguments, "
"there is an additional case - the option string is present but not followed "
"by a command-line argument. In this case the value from const_ will be "
"produced. Some examples to illustrate this::"
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:864
2016-10-30 09:46:26 +00:00
msgid ""
"One of the more common uses of ``nargs='?'`` is to allow optional input and "
"output files::"
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:879
2016-10-30 09:46:26 +00:00
msgid ""
"``'*'``. All command-line arguments present are gathered into a list. Note "
"that it generally doesn't make much sense to have more than one positional "
"argument with ``nargs='*'``, but multiple optional arguments with "
"``nargs='*'`` is possible. For example::"
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:891
2016-10-30 09:46:26 +00:00
msgid ""
"``'+'``. Just like ``'*'``, all command-line args present are gathered into "
"a list. Additionally, an error message will be generated if there wasn't at "
"least one command-line argument present. For example::"
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:905
2016-10-30 09:46:26 +00:00
msgid ""
"``argparse.REMAINDER``. All the remaining command-line arguments are "
"gathered into a list. This is commonly useful for command line utilities "
"that dispatch to other command line utilities::"
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:916
2016-10-30 09:46:26 +00:00
msgid ""
"If the ``nargs`` keyword argument is not provided, the number of arguments "
"consumed is determined by the action_. Generally this means a single "
"command-line argument will be consumed and a single item (not a list) will "
"be produced."
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:922
2016-10-30 09:46:26 +00:00
msgid "const"
msgstr "const"
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:924
2016-10-30 09:46:26 +00:00
msgid ""
"The ``const`` argument of :meth:`~ArgumentParser.add_argument` is used to "
"hold constant values that are not read from the command line but are "
"required for the various :class:`ArgumentParser` actions. The two most "
"common uses of it are:"
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:928
2016-10-30 09:46:26 +00:00
msgid ""
"When :meth:`~ArgumentParser.add_argument` is called with "
"``action='store_const'`` or ``action='append_const'``. These actions add "
"the ``const`` value to one of the attributes of the object returned by :meth:"
"`~ArgumentParser.parse_args`. See the action_ description for examples."
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:933
2016-10-30 09:46:26 +00:00
msgid ""
"When :meth:`~ArgumentParser.add_argument` is called with option strings "
"(like ``-f`` or ``--foo``) and ``nargs='?'``. This creates an optional "
"argument that can be followed by zero or one command-line arguments. When "
"parsing the command line, if the option string is encountered with no "
"command-line argument following it, the value of ``const`` will be assumed "
"instead. See the nargs_ description for examples."
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:940
2016-10-30 09:46:26 +00:00
msgid ""
"With the ``'store_const'`` and ``'append_const'`` actions, the ``const`` "
"keyword argument must be given. For other actions, it defaults to ``None``."
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:945
2016-10-30 09:46:26 +00:00
msgid "default"
msgstr "default"
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:947
2016-10-30 09:46:26 +00:00
msgid ""
"All optional arguments and some positional arguments may be omitted at the "
"command line. The ``default`` keyword argument of :meth:`~ArgumentParser."
"add_argument`, whose value defaults to ``None``, specifies what value should "
"be used if the command-line argument is not present. For optional arguments, "
"the ``default`` value is used when the option string was not present at the "
"command line::"
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:961
2016-10-30 09:46:26 +00:00
msgid ""
"If the ``default`` value is a string, the parser parses the value as if it "
"were a command-line argument. In particular, the parser applies any type_ "
"conversion argument, if provided, before setting the attribute on the :class:"
"`Namespace` return value. Otherwise, the parser uses the value as is::"
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:972
2016-10-30 09:46:26 +00:00
msgid ""
"For positional arguments with nargs_ equal to ``?`` or ``*``, the "
"``default`` value is used when no command-line argument was present::"
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:983
2016-10-30 09:46:26 +00:00
msgid ""
"Providing ``default=argparse.SUPPRESS`` causes no attribute to be added if "
2018-06-10 09:32:30 +00:00
"the command-line argument was not present::"
2016-10-30 09:46:26 +00:00
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:995
2016-10-30 09:46:26 +00:00
msgid "type"
msgstr "type"
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:997
2016-10-30 09:46:26 +00:00
msgid ""
"By default, :class:`ArgumentParser` objects read command-line arguments in "
"as simple strings. However, quite often the command-line string should "
"instead be interpreted as another type, like a :class:`float` or :class:"
"`int`. The ``type`` keyword argument of :meth:`~ArgumentParser."
"add_argument` allows any necessary type-checking and type conversions to be "
"performed. Common built-in types and functions can be used directly as the "
"value of the ``type`` argument::"
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:1010
2016-10-30 09:46:26 +00:00
msgid ""
"See the section on the default_ keyword argument for information on when the "
"``type`` argument is applied to default arguments."
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:1013
2016-10-30 09:46:26 +00:00
msgid ""
"To ease the use of various types of files, the argparse module provides the "
"factory FileType which takes the ``mode=``, ``bufsize=``, ``encoding=`` and "
"``errors=`` arguments of the :func:`open` function. For example, "
"``FileType('w')`` can be used to create a writable file::"
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:1023
2016-10-30 09:46:26 +00:00
msgid ""
"``type=`` can take any callable that takes a single string argument and "
"returns the converted value::"
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:1042
2016-10-30 09:46:26 +00:00
msgid ""
"The choices_ keyword argument may be more convenient for type checkers that "
"simply check against a range of values::"
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:1053
2016-10-30 09:46:26 +00:00
msgid "See the choices_ section for more details."
msgstr "Voir la section choices_ pour plus de détails."
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:1057
2016-10-30 09:46:26 +00:00
msgid "choices"
msgstr "choices"
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:1059
2016-10-30 09:46:26 +00:00
msgid ""
"Some command-line arguments should be selected from a restricted set of "
"values. These can be handled by passing a container object as the *choices* "
"keyword argument to :meth:`~ArgumentParser.add_argument`. When the command "
"line is parsed, argument values will be checked, and an error message will "
"be displayed if the argument was not one of the acceptable values::"
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:1074
2016-10-30 09:46:26 +00:00
msgid ""
"Note that inclusion in the *choices* container is checked after any type_ "
"conversions have been performed, so the type of the objects in the *choices* "
"container should match the type_ specified::"
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:1086
2016-10-30 09:46:26 +00:00
msgid ""
"Any object that supports the ``in`` operator can be passed as the *choices* "
"value, so :class:`dict` objects, :class:`set` objects, custom containers, "
"etc. are all supported."
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:1092
2016-10-30 09:46:26 +00:00
msgid "required"
msgstr "required"
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:1094
2016-10-30 09:46:26 +00:00
msgid ""
"In general, the :mod:`argparse` module assumes that flags like ``-f`` and "
"``--bar`` indicate *optional* arguments, which can always be omitted at the "
"command line. To make an option *required*, ``True`` can be specified for "
"the ``required=`` keyword argument to :meth:`~ArgumentParser.add_argument`::"
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:1107
2016-10-30 09:46:26 +00:00
msgid ""
"As the example shows, if an option is marked as ``required``, :meth:"
"`~ArgumentParser.parse_args` will report an error if that option is not "
"present at the command line."
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:1113
2016-10-30 09:46:26 +00:00
msgid ""
"Required options are generally considered bad form because users expect "
"*options* to be *optional*, and thus they should be avoided when possible."
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:1118
2016-10-30 09:46:26 +00:00
msgid "help"
msgstr "help"
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:1120
2016-10-30 09:46:26 +00:00
msgid ""
"The ``help`` value is a string containing a brief description of the "
"argument. When a user requests help (usually by using ``-h`` or ``--help`` "
"at the command line), these ``help`` descriptions will be displayed with "
"each argument::"
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:1140
2016-10-30 09:46:26 +00:00
msgid ""
"The ``help`` strings can include various format specifiers to avoid "
"repetition of things like the program name or the argument default_. The "
"available specifiers include the program name, ``%(prog)s`` and most keyword "
"arguments to :meth:`~ArgumentParser.add_argument`, e.g. ``%(default)s``, ``"
"%(type)s``, etc.::"
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:1157
2016-10-30 09:46:26 +00:00
msgid ""
"As the help string supports %-formatting, if you want a literal ``%`` to "
"appear in the help string, you must escape it as ``%%``."
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:1160
2016-10-30 09:46:26 +00:00
msgid ""
":mod:`argparse` supports silencing the help entry for certain options, by "
"setting the ``help`` value to ``argparse.SUPPRESS``::"
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:1173
2016-10-30 09:46:26 +00:00
msgid "metavar"
msgstr "metavar"
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:1175
2016-10-30 09:46:26 +00:00
msgid ""
"When :class:`ArgumentParser` generates help messages, it needs some way to "
"refer to each expected argument. By default, ArgumentParser objects use the "
"dest_ value as the \"name\" of each object. By default, for positional "
"argument actions, the dest_ value is used directly, and for optional "
"argument actions, the dest_ value is uppercased. So, a single positional "
"argument with ``dest='bar'`` will be referred to as ``bar``. A single "
"optional argument ``--foo`` that should be followed by a single command-line "
"argument will be referred to as ``FOO``. An example::"
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:1199
2016-10-30 09:46:26 +00:00
msgid "An alternative name can be specified with ``metavar``::"
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:1216
2016-10-30 09:46:26 +00:00
msgid ""
"Note that ``metavar`` only changes the *displayed* name - the name of the "
"attribute on the :meth:`~ArgumentParser.parse_args` object is still "
"determined by the dest_ value."
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:1220
2016-10-30 09:46:26 +00:00
msgid ""
"Different values of ``nargs`` may cause the metavar to be used multiple "
"times. Providing a tuple to ``metavar`` specifies a different display for "
"each of the arguments::"
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:1237
2016-10-30 09:46:26 +00:00
msgid "dest"
msgstr "dest"
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:1239
2016-10-30 09:46:26 +00:00
msgid ""
"Most :class:`ArgumentParser` actions add some value as an attribute of the "
"object returned by :meth:`~ArgumentParser.parse_args`. The name of this "
"attribute is determined by the ``dest`` keyword argument of :meth:"
"`~ArgumentParser.add_argument`. For positional argument actions, ``dest`` "
"is normally supplied as the first argument to :meth:`~ArgumentParser."
"add_argument`::"
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:1251
2016-10-30 09:46:26 +00:00
msgid ""
"For optional argument actions, the value of ``dest`` is normally inferred "
"from the option strings. :class:`ArgumentParser` generates the value of "
"``dest`` by taking the first long option string and stripping away the "
"initial ``--`` string. If no long option strings were supplied, ``dest`` "
"will be derived from the first short option string by stripping the initial "
"``-`` character. Any internal ``-`` characters will be converted to ``_`` "
"characters to make sure the string is a valid attribute name. The examples "
"below illustrate this behavior::"
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:1268
2016-10-30 09:46:26 +00:00
msgid "``dest`` allows a custom attribute name to be provided::"
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:1276
2016-10-30 09:46:26 +00:00
msgid "Action classes"
msgstr "Classes Action"
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:1278
2016-10-30 09:46:26 +00:00
msgid ""
"Action classes implement the Action API, a callable which returns a callable "
"which processes arguments from the command-line. Any object which follows "
"this API may be passed as the ``action`` parameter to :meth:`add_argument`."
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:1287
2016-10-30 09:46:26 +00:00
msgid ""
"Action objects are used by an ArgumentParser to represent the information "
"needed to parse a single argument from one or more strings from the command "
"line. The Action class must accept the two positional arguments plus any "
"keyword arguments passed to :meth:`ArgumentParser.add_argument` except for "
"the ``action`` itself."
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:1293
2016-10-30 09:46:26 +00:00
msgid ""
"Instances of Action (or return value of any callable to the ``action`` "
"parameter) should have attributes \"dest\", \"option_strings\", \"default\", "
"\"type\", \"required\", \"help\", etc. defined. The easiest way to ensure "
"these attributes are defined is to call ``Action.__init__``."
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:1298
2016-10-30 09:46:26 +00:00
msgid ""
"Action instances should be callable, so subclasses must override the "
"``__call__`` method, which should accept four parameters:"
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:1301
2016-10-30 09:46:26 +00:00
msgid "``parser`` - The ArgumentParser object which contains this action."
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:1303
2016-10-30 09:46:26 +00:00
msgid ""
"``namespace`` - The :class:`Namespace` object that will be returned by :meth:"
"`~ArgumentParser.parse_args`. Most actions add an attribute to this object "
"using :func:`setattr`."
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:1307
2016-10-30 09:46:26 +00:00
msgid ""
"``values`` - The associated command-line arguments, with any type "
"conversions applied. Type conversions are specified with the type_ keyword "
"argument to :meth:`~ArgumentParser.add_argument`."
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:1311
2016-10-30 09:46:26 +00:00
msgid ""
"``option_string`` - The option string that was used to invoke this action. "
"The ``option_string`` argument is optional, and will be absent if the action "
"is associated with a positional argument."
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:1315
2016-10-30 09:46:26 +00:00
msgid ""
"The ``__call__`` method may perform arbitrary actions, but will typically "
"set attributes on the ``namespace`` based on ``dest`` and ``values``."
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:1320
2016-10-30 09:46:26 +00:00
msgid "The parse_args() method"
msgstr "La méthode parse_args()"
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:1324
2016-10-30 09:46:26 +00:00
msgid ""
"Convert argument strings to objects and assign them as attributes of the "
"namespace. Return the populated namespace."
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:1327
2016-10-30 09:46:26 +00:00
msgid ""
"Previous calls to :meth:`add_argument` determine exactly what objects are "
"created and how they are assigned. See the documentation for :meth:"
"`add_argument` for details."
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:1331
msgid ""
"args_ - List of strings to parse. The default is taken from :data:`sys."
"argv`."
msgstr ""
#: ../Doc/library/argparse.rst:1334
2016-10-30 09:46:26 +00:00
msgid ""
2017-09-12 11:40:22 +00:00
"namespace_ - An object to take the attributes. The default is a new empty :"
"class:`Namespace` object."
2016-10-30 09:46:26 +00:00
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:1339
2016-10-30 09:46:26 +00:00
msgid "Option value syntax"
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:1341
2016-10-30 09:46:26 +00:00
msgid ""
"The :meth:`~ArgumentParser.parse_args` method supports several ways of "
"specifying the value of an option (if it takes one). In the simplest case, "
"the option and its value are passed as two separate arguments::"
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:1353
2016-10-30 09:46:26 +00:00
msgid ""
"For long options (options with names longer than a single character), the "
"option and value can also be passed as a single command-line argument, using "
"``=`` to separate them::"
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:1360
2016-10-30 09:46:26 +00:00
msgid ""
"For short options (options only one character long), the option and its "
"value can be concatenated::"
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:1366
2016-10-30 09:46:26 +00:00
msgid ""
"Several short options can be joined together, using only a single ``-`` "
"prefix, as long as only the last option (or none of them) requires a value::"
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:1378
2016-10-30 09:46:26 +00:00
msgid "Invalid arguments"
msgstr "Arguments invalides"
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:1380
2016-10-30 09:46:26 +00:00
msgid ""
"While parsing the command line, :meth:`~ArgumentParser.parse_args` checks "
"for a variety of errors, including ambiguous options, invalid types, invalid "
"options, wrong number of positional arguments, etc. When it encounters such "
"an error, it exits and prints the error along with a usage message::"
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:1406
2016-10-30 09:46:26 +00:00
msgid "Arguments containing ``-``"
msgstr "Arguments contenant ``-``"
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:1408
2016-10-30 09:46:26 +00:00
msgid ""
"The :meth:`~ArgumentParser.parse_args` method attempts to give errors "
"whenever the user has clearly made a mistake, but some situations are "
"inherently ambiguous. For example, the command-line argument ``-1`` could "
"either be an attempt to specify an option or an attempt to provide a "
"positional argument. The :meth:`~ArgumentParser.parse_args` method is "
"cautious here: positional arguments may only begin with ``-`` if they look "
"like negative numbers and there are no options in the parser that look like "
"negative numbers::"
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:1446
2016-10-30 09:46:26 +00:00
msgid ""
"If you have positional arguments that must begin with ``-`` and don't look "
"like negative numbers, you can insert the pseudo-argument ``'--'`` which "
"tells :meth:`~ArgumentParser.parse_args` that everything after that is a "
"positional argument::"
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:1457
2016-10-30 09:46:26 +00:00
msgid "Argument abbreviations (prefix matching)"
msgstr "Arguments abrégés (Part comparaison de leur préfixes)"
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:1459
2016-10-30 09:46:26 +00:00
msgid ""
"The :meth:`~ArgumentParser.parse_args` method :ref:`by default "
"<allow_abbrev>` allows long options to be abbreviated to a prefix, if the "
"abbreviation is unambiguous (the prefix matches a unique option)::"
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:1474
2016-10-30 09:46:26 +00:00
msgid ""
"An error is produced for arguments that could produce more than one options. "
"This feature can be disabled by setting :ref:`allow_abbrev` to ``False``."
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:1480
2016-10-30 09:46:26 +00:00
msgid "Beyond ``sys.argv``"
msgstr "Au delà de ``sys.argv``"
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:1482
2016-10-30 09:46:26 +00:00
msgid ""
"Sometimes it may be useful to have an ArgumentParser parse arguments other "
"than those of :data:`sys.argv`. This can be accomplished by passing a list "
"of strings to :meth:`~ArgumentParser.parse_args`. This is useful for "
"testing at the interactive prompt::"
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:1502
2016-10-30 09:46:26 +00:00
msgid "The Namespace object"
msgstr "L'objet namespace"
2016-10-30 09:46:26 +00:00
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:1506
2016-10-30 09:46:26 +00:00
msgid ""
"Simple class used by default by :meth:`~ArgumentParser.parse_args` to create "
"an object holding attributes and return it."
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:1509
2016-10-30 09:46:26 +00:00
msgid ""
"This class is deliberately simple, just an :class:`object` subclass with a "
"readable string representation. If you prefer to have dict-like view of the "
"attributes, you can use the standard Python idiom, :func:`vars`::"
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:1519
2016-10-30 09:46:26 +00:00
msgid ""
"It may also be useful to have an :class:`ArgumentParser` assign attributes "
"to an already existing object, rather than a new :class:`Namespace` object. "
"This can be achieved by specifying the ``namespace=`` keyword argument::"
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:1535
2016-10-30 09:46:26 +00:00
msgid "Other utilities"
msgstr "Autres outils"
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:1538
2016-10-30 09:46:26 +00:00
msgid "Sub-commands"
msgstr "Sous commandes"
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:1545
2016-10-30 09:46:26 +00:00
msgid ""
"Many programs split up their functionality into a number of sub-commands, "
"for example, the ``svn`` program can invoke sub-commands like ``svn "
"checkout``, ``svn update``, and ``svn commit``. Splitting up functionality "
"this way can be a particularly good idea when a program performs several "
"different functions which require different kinds of command-line "
"arguments. :class:`ArgumentParser` supports the creation of such sub-"
"commands with the :meth:`add_subparsers` method. The :meth:`add_subparsers` "
"method is normally called with no arguments and returns a special action "
"object. This object has a single method, :meth:`~ArgumentParser."
"add_parser`, which takes a command name and any :class:`ArgumentParser` "
"constructor arguments, and returns an :class:`ArgumentParser` object that "
"can be modified as usual."
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:1557
2016-10-30 09:46:26 +00:00
msgid "Description of parameters:"
msgstr "Description des paramètres"
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:1559
2016-10-30 09:46:26 +00:00
msgid ""
"title - title for the sub-parser group in help output; by default "
"\"subcommands\" if description is provided, otherwise uses title for "
"positional arguments"
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:1563
2016-10-30 09:46:26 +00:00
msgid ""
"description - description for the sub-parser group in help output, by "
"default ``None``"
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:1566
2016-10-30 09:46:26 +00:00
msgid ""
"prog - usage information that will be displayed with sub-command help, by "
"default the name of the program and any positional arguments before the "
"subparser argument"
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:1570
2016-10-30 09:46:26 +00:00
msgid ""
"parser_class - class which will be used to create sub-parser instances, by "
"default the class of the current parser (e.g. ArgumentParser)"
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:1573
2016-10-30 09:46:26 +00:00
msgid ""
"action_ - the basic type of action to be taken when this argument is "
"encountered at the command line"
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:1576
2016-10-30 09:46:26 +00:00
msgid ""
"dest_ - name of the attribute under which sub-command name will be stored; "
"by default ``None`` and no value is stored"
msgstr ""
2017-09-12 11:40:22 +00:00
#: ../Doc/library/argparse.rst:1579
2018-06-28 13:32:56 +00:00
msgid ""
"required_ - Whether or not a subcommand must be provided, by default "
"``False``."
msgstr ""
#: ../Doc/library/argparse.rst:1582
2016-10-30 09:46:26 +00:00
msgid "help_ - help for sub-parser group in help output, by default ``None``"
msgstr ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/argparse.rst:1584
2016-10-30 09:46:26 +00:00
msgid ""
"metavar_ - string presenting available sub-commands in help; by default it "
"is ``None`` and presents sub-commands in form {cmd1, cmd2, ..}"
msgstr ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/argparse.rst:1587
2016-10-30 09:46:26 +00:00
msgid "Some example usage::"
msgstr "Quelques exemples d'utilisation : ::"
2018-06-28 13:32:56 +00:00
#: ../Doc/library/argparse.rst:1608
2016-10-30 09:46:26 +00:00
msgid ""
"Note that the object returned by :meth:`parse_args` will only contain "
"attributes for the main parser and the subparser that was selected by the "
"command line (and not any other subparsers). So in the example above, when "
"the ``a`` command is specified, only the ``foo`` and ``bar`` attributes are "
"present, and when the ``b`` command is specified, only the ``foo`` and "
"``baz`` attributes are present."
msgstr ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/argparse.rst:1615
2016-10-30 09:46:26 +00:00
msgid ""
"Similarly, when a help message is requested from a subparser, only the help "
"for that particular parser will be printed. The help message will not "
"include parent parser or sibling parser messages. (A help message for each "
"subparser command, however, can be given by supplying the ``help=`` argument "
"to :meth:`add_parser` as above.)"
msgstr ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/argparse.rst:1651
2016-10-30 09:46:26 +00:00
msgid ""
"The :meth:`add_subparsers` method also supports ``title`` and "
"``description`` keyword arguments. When either is present, the subparser's "
"commands will appear in their own group in the help output. For example::"
msgstr ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/argparse.rst:1672
2016-10-30 09:46:26 +00:00
msgid ""
"Furthermore, ``add_parser`` supports an additional ``aliases`` argument, "
"which allows multiple strings to refer to the same subparser. This example, "
"like ``svn``, aliases ``co`` as a shorthand for ``checkout``::"
msgstr ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/argparse.rst:1683
2016-10-30 09:46:26 +00:00
msgid ""
"One particularly effective way of handling sub-commands is to combine the "
"use of the :meth:`add_subparsers` method with calls to :meth:`set_defaults` "
"so that each subparser knows which Python function it should execute. For "
"example::"
msgstr ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/argparse.rst:1720
2016-10-30 09:46:26 +00:00
msgid ""
"This way, you can let :meth:`parse_args` do the job of calling the "
"appropriate function after argument parsing is complete. Associating "
"functions with actions like this is typically the easiest way to handle the "
"different actions for each of your subparsers. However, if it is necessary "
"to check the name of the subparser that was invoked, the ``dest`` keyword "
"argument to the :meth:`add_subparsers` call will work::"
msgstr ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/argparse.rst:1738
2016-10-30 09:46:26 +00:00
msgid "FileType objects"
msgstr "Objets ``FileType``"
2018-06-28 13:32:56 +00:00
#: ../Doc/library/argparse.rst:1742
2016-10-30 09:46:26 +00:00
msgid ""
"The :class:`FileType` factory creates objects that can be passed to the type "
"argument of :meth:`ArgumentParser.add_argument`. Arguments that have :class:"
"`FileType` objects as their type will open command-line arguments as files "
"with the requested modes, buffer sizes, encodings and error handling (see "
"the :func:`open` function for more details)::"
msgstr ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/argparse.rst:1754
2016-10-30 09:46:26 +00:00
msgid ""
"FileType objects understand the pseudo-argument ``'-'`` and automatically "
"convert this into ``sys.stdin`` for readable :class:`FileType` objects and "
"``sys.stdout`` for writable :class:`FileType` objects::"
msgstr ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/argparse.rst:1763
2016-10-30 09:46:26 +00:00
msgid "The *encodings* and *errors* keyword arguments."
msgstr "Les arguments nommés ``encodings`` et ``errors``."
2018-06-28 13:32:56 +00:00
#: ../Doc/library/argparse.rst:1768
2016-10-30 09:46:26 +00:00
msgid "Argument groups"
msgstr "Groupes d'arguments"
2018-06-28 13:32:56 +00:00
#: ../Doc/library/argparse.rst:1772
2016-10-30 09:46:26 +00:00
msgid ""
"By default, :class:`ArgumentParser` groups command-line arguments into "
"\"positional arguments\" and \"optional arguments\" when displaying help "
"messages. When there is a better conceptual grouping of arguments than this "
"default one, appropriate groups can be created using the :meth:"
"`add_argument_group` method::"
msgstr ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/argparse.rst:1789
2016-10-30 09:46:26 +00:00
msgid ""
"The :meth:`add_argument_group` method returns an argument group object which "
"has an :meth:`~ArgumentParser.add_argument` method just like a regular :"
"class:`ArgumentParser`. When an argument is added to the group, the parser "
"treats it just like a normal argument, but displays the argument in a "
"separate group for help messages. The :meth:`add_argument_group` method "
"accepts *title* and *description* arguments which can be used to customize "
"this display::"
msgstr ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/argparse.rst:1815
2016-10-30 09:46:26 +00:00
msgid ""
"Note that any arguments not in your user-defined groups will end up back in "
"the usual \"positional arguments\" and \"optional arguments\" sections."
msgstr ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/argparse.rst:1820
2016-10-30 09:46:26 +00:00
msgid "Mutual exclusion"
msgstr "Exclusion mutuelle"
2018-06-28 13:32:56 +00:00
#: ../Doc/library/argparse.rst:1824
2016-10-30 09:46:26 +00:00
msgid ""
"Create a mutually exclusive group. :mod:`argparse` will make sure that only "
"one of the arguments in the mutually exclusive group was present on the "
"command line::"
msgstr ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/argparse.rst:1840
2016-10-30 09:46:26 +00:00
msgid ""
"The :meth:`add_mutually_exclusive_group` method also accepts a *required* "
"argument, to indicate that at least one of the mutually exclusive arguments "
"is required::"
msgstr ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/argparse.rst:1852
2016-10-30 09:46:26 +00:00
msgid ""
"Note that currently mutually exclusive argument groups do not support the "
"*title* and *description* arguments of :meth:`~ArgumentParser."
"add_argument_group`."
msgstr ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/argparse.rst:1858
2016-10-30 09:46:26 +00:00
msgid "Parser defaults"
msgstr "Valeurs par défaut du parseur"
2018-06-28 13:32:56 +00:00
#: ../Doc/library/argparse.rst:1862
2016-10-30 09:46:26 +00:00
msgid ""
"Most of the time, the attributes of the object returned by :meth:"
"`parse_args` will be fully determined by inspecting the command-line "
"arguments and the argument actions. :meth:`set_defaults` allows some "
"additional attributes that are determined without any inspection of the "
"command line to be added::"
msgstr ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/argparse.rst:1874
2016-10-30 09:46:26 +00:00
msgid ""
"Note that parser-level defaults always override argument-level defaults::"
msgstr ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/argparse.rst:1882
2016-10-30 09:46:26 +00:00
msgid ""
"Parser-level defaults can be particularly useful when working with multiple "
"parsers. See the :meth:`~ArgumentParser.add_subparsers` method for an "
"example of this type."
msgstr ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/argparse.rst:1888
2016-10-30 09:46:26 +00:00
msgid ""
"Get the default value for a namespace attribute, as set by either :meth:"
"`~ArgumentParser.add_argument` or by :meth:`~ArgumentParser.set_defaults`::"
msgstr ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/argparse.rst:1899
2016-10-30 09:46:26 +00:00
msgid "Printing help"
msgstr "Afficher l'aide"
2018-06-28 13:32:56 +00:00
#: ../Doc/library/argparse.rst:1901
2016-10-30 09:46:26 +00:00
msgid ""
"In most typical applications, :meth:`~ArgumentParser.parse_args` will take "
"care of formatting and printing any usage or error messages. However, "
"several formatting methods are available:"
msgstr ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/argparse.rst:1907
2016-10-30 09:46:26 +00:00
msgid ""
"Print a brief description of how the :class:`ArgumentParser` should be "
"invoked on the command line. If *file* is ``None``, :data:`sys.stdout` is "
"assumed."
msgstr ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/argparse.rst:1913
2016-10-30 09:46:26 +00:00
msgid ""
"Print a help message, including the program usage and information about the "
"arguments registered with the :class:`ArgumentParser`. If *file* is "
"``None``, :data:`sys.stdout` is assumed."
msgstr ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/argparse.rst:1917
2016-10-30 09:46:26 +00:00
msgid ""
"There are also variants of these methods that simply return a string instead "
"of printing it:"
msgstr ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/argparse.rst:1922
2016-10-30 09:46:26 +00:00
msgid ""
"Return a string containing a brief description of how the :class:"
"`ArgumentParser` should be invoked on the command line."
msgstr ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/argparse.rst:1927
2016-10-30 09:46:26 +00:00
msgid ""
"Return a string containing a help message, including the program usage and "
"information about the arguments registered with the :class:`ArgumentParser`."
msgstr ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/argparse.rst:1932
2016-10-30 09:46:26 +00:00
msgid "Partial parsing"
msgstr "*Parsing* partiel"
2018-06-28 13:32:56 +00:00
#: ../Doc/library/argparse.rst:1936
2016-10-30 09:46:26 +00:00
msgid ""
"Sometimes a script may only parse a few of the command-line arguments, "
"passing the remaining arguments on to another script or program. In these "
"cases, the :meth:`~ArgumentParser.parse_known_args` method can be useful. "
"It works much like :meth:`~ArgumentParser.parse_args` except that it does "
"not produce an error when extra arguments are present. Instead, it returns "
"a two item tuple containing the populated namespace and the list of "
"remaining argument strings."
msgstr ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/argparse.rst:1952
2016-10-30 09:46:26 +00:00
msgid ""
":ref:`Prefix matching <prefix-matching>` rules apply to :meth:"
"`parse_known_args`. The parser may consume an option even if it's just a "
"prefix of one of its known options, instead of leaving it in the remaining "
"arguments list."
msgstr ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/argparse.rst:1959
2016-10-30 09:46:26 +00:00
msgid "Customizing file parsing"
msgstr "Personnaliser le *parsing* de fichiers"
2018-06-28 13:32:56 +00:00
#: ../Doc/library/argparse.rst:1963
2016-10-30 09:46:26 +00:00
msgid ""
"Arguments that are read from a file (see the *fromfile_prefix_chars* keyword "
"argument to the :class:`ArgumentParser` constructor) are read one argument "
"per line. :meth:`convert_arg_line_to_args` can be overridden for fancier "
"reading."
msgstr ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/argparse.rst:1968
2016-10-30 09:46:26 +00:00
msgid ""
"This method takes a single argument *arg_line* which is a string read from "
"the argument file. It returns a list of arguments parsed from this string. "
"The method is called once per line read from the argument file, in order."
msgstr ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/argparse.rst:1972
2016-10-30 09:46:26 +00:00
msgid ""
"A useful override of this method is one that treats each space-separated "
"word as an argument. The following example demonstrates how to do this::"
msgstr ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/argparse.rst:1981
2016-10-30 09:46:26 +00:00
msgid "Exiting methods"
msgstr ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/argparse.rst:1985
2016-10-30 09:46:26 +00:00
msgid ""
"This method terminates the program, exiting with the specified *status* and, "
"if given, it prints a *message* before that."
msgstr ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/argparse.rst:1990
2016-10-30 09:46:26 +00:00
msgid ""
"This method prints a usage message including the *message* to the standard "
"error and terminates the program with a status code of 2."
msgstr ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/argparse.rst:1995
msgid "Intermixed parsing"
2018-07-21 08:59:44 +00:00
msgstr "Analyse entremêlée"
2018-06-28 13:32:56 +00:00
#: ../Doc/library/argparse.rst:2000
msgid ""
"A number of Unix commands allow the user to intermix optional arguments with "
"positional arguments. The :meth:`~ArgumentParser.parse_intermixed_args` "
"and :meth:`~ArgumentParser.parse_known_intermixed_args` methods support this "
"parsing style."
msgstr ""
#: ../Doc/library/argparse.rst:2005
msgid ""
"These parsers do not support all the argparse features, and will raise "
"exceptions if unsupported features are used. In particular, subparsers, "
"``argparse.REMAINDER``, and mutually exclusive groups that include both "
"optionals and positionals are not supported."
msgstr ""
#: ../Doc/library/argparse.rst:2010
msgid ""
"The following example shows the difference between :meth:`~ArgumentParser."
"parse_known_args` and :meth:`~ArgumentParser.parse_intermixed_args`: the "
"former returns ``['2', '3']`` as unparsed arguments, while the latter "
"collects all the positionals into ``rest``. ::"
msgstr ""
#: ../Doc/library/argparse.rst:2025
msgid ""
":meth:`~ArgumentParser.parse_known_intermixed_args` returns a two item tuple "
"containing the populated namespace and the list of remaining argument "
"strings. :meth:`~ArgumentParser.parse_intermixed_args` raises an error if "
"there are any remaining unparsed argument strings."
msgstr ""
#: ../Doc/library/argparse.rst:2035
2016-10-30 09:46:26 +00:00
msgid "Upgrading optparse code"
msgstr "Mettre à jour du code ``optparse``"
2018-06-28 13:32:56 +00:00
#: ../Doc/library/argparse.rst:2037
2016-10-30 09:46:26 +00:00
msgid ""
"Originally, the :mod:`argparse` module had attempted to maintain "
"compatibility with :mod:`optparse`. However, :mod:`optparse` was difficult "
"to extend transparently, particularly with the changes required to support "
"the new ``nargs=`` specifiers and better usage messages. When most "
"everything in :mod:`optparse` had either been copy-pasted over or monkey-"
"patched, it no longer seemed practical to try to maintain the backwards "
"compatibility."
msgstr ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/argparse.rst:2044
2016-10-30 09:46:26 +00:00
msgid ""
"The :mod:`argparse` module improves on the standard library :mod:`optparse` "
"module in a number of ways including:"
msgstr ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/argparse.rst:2047
2016-10-30 09:46:26 +00:00
msgid "Handling positional arguments."
2018-03-20 23:16:43 +00:00
msgstr "Gérer les arguments positionnels."
2016-10-30 09:46:26 +00:00
2018-06-28 13:32:56 +00:00
#: ../Doc/library/argparse.rst:2048
2016-10-30 09:46:26 +00:00
msgid "Supporting sub-commands."
msgstr "Gérer les sous commandes."
2018-06-28 13:32:56 +00:00
#: ../Doc/library/argparse.rst:2049
2016-10-30 09:46:26 +00:00
msgid "Allowing alternative option prefixes like ``+`` and ``/``."
msgstr ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/argparse.rst:2050
2016-10-30 09:46:26 +00:00
msgid "Handling zero-or-more and one-or-more style arguments."
msgstr ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/argparse.rst:2051
2016-10-30 09:46:26 +00:00
msgid "Producing more informative usage messages."
msgstr "Fournir des message d'aide plus complets."
2018-06-28 13:32:56 +00:00
#: ../Doc/library/argparse.rst:2052
2016-10-30 09:46:26 +00:00
msgid "Providing a much simpler interface for custom ``type`` and ``action``."
msgstr ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/argparse.rst:2054
2016-10-30 09:46:26 +00:00
msgid "A partial upgrade path from :mod:`optparse` to :mod:`argparse`:"
msgstr ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/argparse.rst:2056
2016-10-30 09:46:26 +00:00
msgid ""
"Replace all :meth:`optparse.OptionParser.add_option` calls with :meth:"
"`ArgumentParser.add_argument` calls."
msgstr ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/argparse.rst:2059
2016-10-30 09:46:26 +00:00
msgid ""
"Replace ``(options, args) = parser.parse_args()`` with ``args = parser."
"parse_args()`` and add additional :meth:`ArgumentParser.add_argument` calls "
"for the positional arguments. Keep in mind that what was previously called "
2017-09-12 11:40:22 +00:00
"``options``, now in the :mod:`argparse` context is called ``args``."
2016-10-30 09:46:26 +00:00
msgstr ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/argparse.rst:2064
2017-09-12 11:40:22 +00:00
msgid ""
2018-06-28 13:32:56 +00:00
"Replace :meth:`optparse.OptionParser.disable_interspersed_args` by using :"
"meth:`~ArgumentParser.parse_intermixed_args` instead of :meth:"
"`~ArgumentParser.parse_args`."
2017-09-12 11:40:22 +00:00
msgstr ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/argparse.rst:2068
2016-10-30 09:46:26 +00:00
msgid ""
"Replace callback actions and the ``callback_*`` keyword arguments with "
"``type`` or ``action`` arguments."
msgstr ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/argparse.rst:2071
2016-10-30 09:46:26 +00:00
msgid ""
"Replace string names for ``type`` keyword arguments with the corresponding "
"type objects (e.g. int, float, complex, etc)."
msgstr ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/argparse.rst:2074
2016-10-30 09:46:26 +00:00
msgid ""
"Replace :class:`optparse.Values` with :class:`Namespace` and :exc:`optparse."
"OptionError` and :exc:`optparse.OptionValueError` with :exc:`ArgumentError`."
msgstr ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/argparse.rst:2078
2016-10-30 09:46:26 +00:00
msgid ""
"Replace strings with implicit arguments such as ``%default`` or ``%prog`` "
"with the standard Python syntax to use dictionaries to format strings, that "
"is, ``%(default)s`` and ``%(prog)s``."
msgstr ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/argparse.rst:2082
2016-10-30 09:46:26 +00:00
msgid ""
"Replace the OptionParser constructor ``version`` argument with a call to "
"``parser.add_argument('--version', action='version', version='<the "
"version>')``."
msgstr ""