mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Fix errors found by "make suspicious".
This commit is contained in:
parent
fa4f7f97b8
commit
682d7e0e07
14 changed files with 30 additions and 28 deletions
|
@ -737,14 +737,14 @@ values are:
|
|||
* N (an integer). N args from the command-line will be gathered together into a
|
||||
list. For example::
|
||||
|
||||
>>> parser = argparse.ArgumentParser()
|
||||
>>> parser.add_argument('--foo', nargs=2)
|
||||
>>> parser.add_argument('bar', nargs=1)
|
||||
>>> parser.parse_args('c --foo a b'.split())
|
||||
Namespace(bar=['c'], foo=['a', 'b'])
|
||||
>>> parser = argparse.ArgumentParser()
|
||||
>>> parser.add_argument('--foo', nargs=2)
|
||||
>>> parser.add_argument('bar', nargs=1)
|
||||
>>> parser.parse_args('c --foo a b'.split())
|
||||
Namespace(bar=['c'], foo=['a', 'b'])
|
||||
|
||||
Note that ``nargs=1`` produces a list of one item. This is different from
|
||||
the default, in which the item is produced by itself.
|
||||
Note that ``nargs=1`` produces a list of one item. This is different from
|
||||
the default, in which the item is produced by itself.
|
||||
|
||||
* ``'?'``. One arg will be consumed from the command-line if possible, and
|
||||
produced as a single item. If no command-line arg is present, the value from
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue