@@ -844,6 +844,8 @@ values are:
844844 Note that ``nargs=1 `` produces a list of one item. This is different from
845845 the default, in which the item is produced by itself.
846846
847+ .. index :: single: ? (question mark); in argparse module
848+
847849* ``'?' ``. One argument will be consumed from the command line if possible, and
848850 produced as a single item. If no command-line argument is present, the value from
849851 default _ will be produced. Note that for optional arguments, there is an
@@ -876,6 +878,8 @@ values are:
876878 Namespace(infile=<_io.TextIOWrapper name='<stdin>' encoding='UTF-8'>,
877879 outfile=<_io.TextIOWrapper name='<stdout>' encoding='UTF-8'>)
878880
881+ .. index :: single: * (asterisk); in argparse module
882+
879883* ``'*' ``. All command-line arguments present are gathered into a list. Note that
880884 it generally doesn't make much sense to have more than one positional argument
881885 with ``nargs='*' ``, but multiple optional arguments with ``nargs='*' `` is
@@ -888,6 +892,8 @@ values are:
888892 >>> parser.parse_args('a b --foo x y --bar 1 2'.split())
889893 Namespace(bar=['1', '2'], baz=['a', 'b'], foo=['x', 'y'])
890894
895+ .. index :: single: + (plus); in argparse module
896+
891897* ``'+' ``. Just like ``'*' ``, all command-line args present are gathered into a
892898 list. Additionally, an error message will be generated if there wasn't at
893899 least one command-line argument present. For example::
0 commit comments