[New-bugs-announce] [issue15062] argparse: option for a positional argument

wrobell report at bugs.python.org
Thu Jun 14 01:15:46 CEST 2012


New submission from wrobell <wrobell at pld-linux.org>:

it would be great if argparse allowed to specify options for multiple positional arguments, i.e.

  usage: ascript [-h] [-k value] input [[-k value] input ...] output

then

$ ascript pos1 pos2 -k 1 pos3 -k 2 pos4 pos5 pos6 out

would give      

Namespace(input=[(None, 'pos1'), (None, 'pos2'), ('1', 'pos3'), ('2', 'pos4'), (None, 'pos5'), ('None', 'pos6')], output=['out'])

----------
components: Library (Lib)
messages: 162741
nosy: wrobell
priority: normal
severity: normal
status: open
title: argparse: option for a positional argument
type: enhancement

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue15062>
_______________________________________


More information about the New-bugs-announce mailing list