[issue15062] argparse: option for a positional argument

2012-06-16 Thread Georg Brandl
Georg Brandl added the comment: What alternate syntax would you suggest for a "find" type command then (other than replacing "-long" by "--long")? -- nosy: +georg.brandl ___ Python tracker ___

[issue15062] argparse: option for a positional argument

2012-06-16 Thread Éric Araujo
Éric Araujo added the comment: I wouldn’t use the syntax used by find, dd or other very old and peculiar commands as an example for anything new :) -- nosy: +eric.araujo ___ Python tracker ___

[issue15062] argparse: option for a positional argument

2012-06-13 Thread R. David Murray
R. David Murray added the comment: Well, if you can figure out how to add it, please do suggest a patch :) It occurs to me that 'find' is a sort-of similar example, where options can be repeated but the order in which they appear relative to other options matters. So I can see that there cou

[issue15062] argparse: option for a positional argument

2012-06-13 Thread wrobell
wrobell added the comment: an example would be a pdf merger accepting multiple files and allowing to specify list of pages for each input. at the moment, you can do the following with argparse pdfmerge [pages] input [[pages] input ...] output of course, above is not perfect as you need a

[issue15062] argparse: option for a positional argument

2012-06-13 Thread R. David Murray
R. David Murray added the comment: It took me a while to make any sense out of your example, but having done so I don't think it makes any sense in the argparse context. It is certainly not the way argparse handles options or arguments. In argparse, if you have an option 'k', you get 'k' map

[issue15062] argparse: option for a positional argument

2012-06-13 Thread wrobell
New submission from wrobell : 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=[(N