[issue9182] document “--” as a way to disti nguish option w/ narg='+' from positional argument in arg parse

2010-11-21 Thread Daniel Albeseder
Daniel Albeseder ko...@gmx.at added the comment: Steven: From msg121850 I think the last two examples do not need the --. Since there are no positional arguments, the -- is not needed. However the following additional cases exist: -x X [X ...] -y Y -- A B # since optionals might come in other

[issue9182] document “--” as a way to disti nguish option w/ narg='+' from positional argument in arg parse

2010-11-21 Thread Daniel Albeseder
Daniel Albeseder ko...@gmx.at added the comment: Added more unit tests for testing the help text as well as the functionality of the -- separator. -- keywords: +patch Added file: http://bugs.python.org/file19731/issue9182.patch ___ Python tracker

[issue9182] document “--” as a way to disti nguish option w/ narg='+' from positional argument in arg parse

2010-11-21 Thread Daniel Albeseder
Changes by Daniel Albeseder ko...@gmx.at: Removed file: http://bugs.python.org/file19731/issue9182.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9182 ___

[issue9182] document “--” as a way to disti nguish option w/ narg='+' from positional argument in arg parse

2010-11-21 Thread Daniel Albeseder
Changes by Daniel Albeseder ko...@gmx.at: Added file: http://bugs.python.org/file19732/issue9182.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9182 ___

[issue9182] document “--” as a way to disti nguish option w/ narg='+' from positional argument in arg parse

2010-11-21 Thread Steven Bethard
Steven Bethard steven.beth...@gmail.com added the comment: Yeah, sorry, those last two should have had arguments after them. I think we have to stick with the current behavior - otherwise there's no way to do something like -x -A -B, where you want -A and -B to be arguments to -x. (You can

[issue9182] document “--” as a way to disti nguish option w/ narg='+' from positional argument in arg parse

2010-11-21 Thread Daniel Albeseder
Daniel Albeseder ko...@gmx.at added the comment: Steven: The last part I guess would belong better in issue 9334. Using a -- to end all optionals is just a convention but -- could also be the argument to some option as well. We need to limit this in any way, and the way it is done right now

[issue9182] document “--” as a way to disti nguish option w/ narg='+' from positional argument in arg parse

2010-11-20 Thread Daniel Albeseder
Daniel Albeseder ko...@gmx.at added the comment: I did the patch for adding the -- in the generated usage text inside issue 9338. -- nosy: +Kotan ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9182

[issue9182] document “--” as a way to disti nguish option w/ narg='+' from positional argument in arg parse

2010-11-20 Thread Steven Bethard
Steven Bethard steven.beth...@gmail.com added the comment: Sorry, I think I confused you, please post that patch here. This issue is for documenting the workarounds, issue 9338 is for actually solving the problem. I glanced at your patch on that issue, and it looks basically okay, though I'd

[issue9182] document “--” as a way to disti nguish option w/ narg='+' from positional argument in arg parse

2010-11-19 Thread Éric Araujo
Éric Araujo mer...@netwok.org added the comment: Sergey: Do you want to make a patch for that, and/or for the documentation? Guidelines are on http://www.python.org/dev/patches/ -- nosy: +bethard resolution: accepted - versions: +Python 3.1, Python 3.2 -Python 2.6

[issue9182] document “--” as a way to disti nguish option w/ narg='+' from positional argument in arg parse

2010-11-19 Thread Steven Bethard
Steven Bethard steven.beth...@gmail.com added the comment: The original point is basically a duplicate of issue 9338. It is undesirable behavior, I just don't know how to fix it. Patches to fix it are welcome (on issue 9338). ;-) As to documenting '--', I agree it's hidden too far down in the

[issue9182] document “--” as a way to disti nguish option w/ narg='+' from positional argument in arg parse

2010-11-19 Thread Éric Araujo
Éric Araujo mer...@netwok.org added the comment: You’re right, sorry I was unclear: “a patch for that” referred to the addition of “--” in the generated usage text. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9182

[issue9182] document “--” as a way to disti nguish option w/ narg='+' from positional argument in arg parse

2010-07-06 Thread Éric Araujo
Éric Araujo mer...@netwok.org added the comment: I always forget that not all programs follow getopt-style parsing rules, thanks for the reminder. -- keywords: +easy resolution: - accepted title: argparse: optional argument w/ narg='+' conflicts w/ positional argsument - document

[issue9182] document “--” as a way to disti nguish option w/ narg='+' from positional argument in arg parse

2010-07-06 Thread Sergey Konoplev
Sergey Konoplev gray...@gmail.com added the comment: Thank you for the hint. It is realy not so obvious. May be it is worth to add -- into the usage string this way usage: [-h] [-b BAR [BAR ...]] -- foo Otherwise it leads to misunderstanding. --