[issue9253] argparse: optional subparsers

2020-04-03 Thread brent s.
Change by brent s. : -- nosy: +bsaner ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue9253] argparse: optional subparsers

2019-08-24 Thread Ashwin Ramaswami
Change by Ashwin Ramaswami : -- nosy: +epicfaace ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue9253] argparse: optional subparsers

2017-10-18 Thread paul j3
paul j3 added the comment: In a recent stackoverflow question a user wanted this optional-subparsers ability in Python 2.7. https://stackoverflow.com/questions/46667843/how-to-set-a-default-subparser-using-argparse-module-with-python-2-7 Short of modifying the

[issue9253] argparse: optional subparsers

2017-09-20 Thread Éric Araujo
Éric Araujo added the comment: The other PR is now merged in 3.7, and won’t be backported (it changes default behaviour and adds a new param). -- ___ Python tracker

[issue9253] argparse: optional subparsers

2017-09-20 Thread Éric Araujo
Changes by Éric Araujo : -- dependencies: +[argparse] Add required argument to add_subparsers versions: +Python 3.7 -Python 3.3 ___ Python tracker

[issue9253] argparse: optional subparsers

2017-09-15 Thread Anthony Sottile
Anthony Sottile added the comment: My patch mainly addresses the regression pointed out by mike bayer (zzzeek)'s comment. -- ___ Python tracker ___

[issue9253] argparse: optional subparsers

2017-09-15 Thread Éric Araujo
Éric Araujo added the comment: I am now reviewing the PR added to the other issue by Anthony. This ticket has a lot of discussion; it would be good to check which parts are addressed by the other ticket, and particularly if the problems noted by Mike and others are now fixed. --

[issue9253] argparse: optional subparsers

2017-08-14 Thread Anthony Sottile
Anthony Sottile added the comment: I've attempted to address some of the backward/forward compatibility issue with subparsers becoming optional by default (vs required by default in python2) with this pull request: https://github.com/python/cpython/pull/3027 (would love to get a review as

[issue9253] argparse: optional subparsers

2016-12-18 Thread Hans-Peter Jansen
Changes by Hans-Peter Jansen : -- nosy: +frispete ___ Python tracker ___ ___ Python-bugs-list

[issue9253] argparse: optional subparsers

2016-09-28 Thread Mariatta Wijaya
Changes by Mariatta Wijaya : -- nosy: +Mariatta ___ Python tracker ___ ___

[issue9253] argparse: optional subparsers

2016-06-07 Thread paul j3
paul j3 added the comment: My answer to http://stackoverflow.com/questions/23349349/argparse-with-required-subparser is getting a slow but steady stream of + scores; so the `required subparser` issue is still bothering people. This particular question addresses the problem that the error

[issue9253] argparse: optional subparsers

2015-09-19 Thread Jakub Wilk
Changes by Jakub Wilk : -- nosy: +jwilk ___ Python tracker ___ ___ Python-bugs-list mailing

[issue9253] argparse: optional subparsers

2015-03-12 Thread BJ Dierkes
Changes by BJ Dierkes wdier...@gmail.com: -- nosy: +derks ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9253 ___ ___ Python-bugs-list mailing list

[issue9253] argparse: optional subparsers

2014-05-23 Thread Sergey Vilgelm
Changes by Sergey Vilgelm ser...@vilgelm.info: -- nosy: +svilgelm ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9253 ___ ___ Python-bugs-list

[issue9253] argparse: optional subparsers

2014-05-13 Thread couplewavylines
Changes by couplewavylines couplewavyli...@gmail.com: -- nosy: +couplewavylines ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9253 ___ ___

[issue9253] argparse: optional subparsers

2014-04-28 Thread paul j3
paul j3 added the comment: Another Stackoverflow question triggered by this issue http://stackoverflow.com/questions/23349349/argparse-with-required-subparser -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9253

[issue9253] argparse: optional subparsers

2014-04-10 Thread paul j3
paul j3 added the comment: http://stackoverflow.com/questions/22990977/why-does-this-argparse-code-behave-differently-between-python-2-and-3 is answered by this change in how `required` arguments are tested, and how subparsers fell through the cracks. --

[issue9253] argparse: optional subparsers

2013-07-30 Thread paul j3
paul j3 added the comment: msg113512 - (view) Author: Steven Bethard (bethard) Seems like there's minimally the bug that argparse should currently throw an error if you add an argument after subparsers (since that argument will never be parsed under the current semantics). This isn't

[issue9253] argparse: optional subparsers

2013-04-13 Thread paul j3
paul j3 added the comment: This patch addresses both issues raised here: - throw an error when the subparser argument is missing - allow the subparser argument to be optional argparse.py: _SubParsersAction - add 'required=True' keyword. name(self) method - creates a name of the form

[issue9253] argparse: optional subparsers

2013-04-10 Thread paul j3
paul j3 added the comment: Further observations: parser.add_subparsers() accepts a 'dest' keyword arg, but not a 'required' one. Default of 'dest' is SUPPRESS, so the name does not appear in the Namespace. Changing it to something like 'command' will produce an entry, e.g.

[issue9253] argparse: optional subparsers

2013-04-09 Thread paul j3
paul j3 added the comment: I think this problem arises from a change made in http://bugs.python.org/issue10424 Changeset to default (i.e. development) is http://hg.python.org/cpython/rev/cab204a79e09 Near the end of _parse_known_args it removes a: if positionals: self.error(_('too

[issue9253] argparse: optional subparsers

2013-04-04 Thread Sebastien Luttringer
Sebastien Luttringer added the comment: I got the same issue that mike bayer with argparse doesn't throw error when subparser are missing. Is it a bug which should be fixed in Python or in all python script? This sounds like an API break. -- nosy: +seblu

[issue9253] argparse: optional subparsers

2013-02-10 Thread mike bayer
mike bayer added the comment: um, this seems like a regression/bug? I now have users complaining that my apps are broken because of this change as of Python 3.3.My application is supposed to return the help screen when no command is given. Now I get a None error because argparse is not

[issue9253] argparse: optional subparsers

2013-02-07 Thread Bohuslav Slavek Kabrda
Changes by Bohuslav Slavek Kabrda bkab...@redhat.com: -- nosy: +bkabrda ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9253 ___ ___

[issue9253] argparse: optional subparsers

2013-01-25 Thread Chris Jerdonek
Changes by Chris Jerdonek chris.jerdo...@gmail.com: -- nosy: +chris.jerdonek ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9253 ___ ___

[issue9253] argparse: optional subparsers

2013-01-18 Thread W. Trevor King
W. Trevor King added the comment: Since [1] it seems like subparsers *are* optional by default. At least I get “error: too few arguments” for version 70740 of Lib/argparse.py, but no error for version 70741. It looks like this may be an unintentional side effect, since I see no mention of

[issue9253] argparse: optional subparsers

2012-09-14 Thread Benjamin West
Benjamin West added the comment: https://gist.github.com/1202975#file_test_opt_subcommand.py I sketched out a sloppy test earlier. I think this test is probably not quite comprehensive enough, and I'm not sure it fits into the python style either. I suppose there are other tests I can more

[issue9253] argparse: optional subparsers

2012-09-13 Thread Julian Berman
Changes by Julian Berman julian+python@grayvines.com: -- nosy: +Julian ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9253 ___ ___

[issue9253] argparse: optional subparsers

2012-09-13 Thread R. David Murray
Changes by R. David Murray rdmur...@bitdance.com: -- stage: needs patch - test needed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9253 ___ ___

[issue9253] argparse: optional subparsers

2012-02-20 Thread Steven Bethard
Steven Bethard steven.beth...@gmail.com added the comment: The implementation looks along the right track. Now it just needs some tests. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9253

[issue9253] argparse: optional subparsers

2012-02-18 Thread Daniel Neuhäuser
Changes by Daniel Neuhäuser dasdas...@googlemail.com: -- nosy: +DasIch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9253 ___ ___ Python-bugs-list

[issue9253] argparse: optional subparsers

2012-01-12 Thread Éric Araujo
Changes by Éric Araujo mer...@netwok.org: -- hgrepos: +102 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9253 ___ ___ Python-bugs-list mailing

[issue9253] argparse: optional subparsers

2012-01-12 Thread Éric Araujo
Changes by Éric Araujo mer...@netwok.org: -- keywords: +patch Added file: http://bugs.python.org/file24217/ed0fce615582.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9253 ___

[issue9253] argparse: optional subparsers

2012-01-09 Thread Éric Araujo
Changes by Éric Araujo mer...@netwok.org: -- Removed message: http://bugs.python.org/msg150758 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9253 ___

[issue9253] argparse: optional subparsers

2012-01-09 Thread Éric Araujo
Changes by Éric Araujo mer...@netwok.org: -- Removed message: http://bugs.python.org/msg150815 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9253 ___

[issue9253] argparse: optional subparsers

2012-01-09 Thread Éric Araujo
Changes by Éric Araujo mer...@netwok.org: -- Removed message: http://bugs.python.org/msg150820 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9253 ___

[issue9253] argparse: optional subparsers

2012-01-09 Thread Éric Araujo
Éric Araujo mer...@netwok.org added the comment: Thanks for persevering in the face of VCS complications :) I have added a warning to the obsolete Git wiki page; I can’t do anything for the argparse Google code page. Anyway, trust us that argparse in the 3.3 stdlib is the place where

[issue9253] argparse: optional subparsers

2012-01-07 Thread Benjamin West
Benjamin West bew...@gmail.com added the comment: Thanks Eric. I was thrown by this document: http://wiki.python.org/moin/Git which describes fetching the sources from SVN using git. I'm comfortable doing either, but it doesn't resolve my confusion. The version of argparse in the python

[issue9253] argparse: optional subparsers

2012-01-07 Thread Benjamin West
Benjamin West bew...@gmail.com added the comment: Thanks Eric. I was thrown by this document: http://wiki.python.org/moin/Git which describes fetching the sources from SVN using git. I'm comfortable doing either, but it doesn't resolve my confusion. The version of argparse in the python

[issue9253] argparse: optional subparsers

2012-01-07 Thread Benjamin West
Benjamin West bew...@gmail.com added the comment: Ok, here's a rough attempt at stubbing this out against a python checkout. Will try to look at adding tests. (BTW, subsequent GETs should not modify the bug tracker... this seems like a bug since GET should be idempotent, but SFTN from the

[issue9253] argparse: optional subparsers

2012-01-07 Thread Benjamin West
Benjamin West bew...@gmail.com added the comment: Ok, here's a rough attempt at stubbing this out against a python checkout. Will try to look at adding tests. (BTW, subsequent GETs should not modify the bug tracker... this seems like a bug since GET should be idempotent, but SFTN from the

[issue9253] argparse: optional subparsers

2012-01-06 Thread Benjamin West
Benjamin West bew...@gmail.com added the comment: Ok, Steven, that sounds reasonable. I checked out git-svn python and started comparing diffs... I'm a little confused. What version of argparse should be patched to provide this feature? My HG version from https://code.google.com/p/argparse/

[issue9253] argparse: optional subparsers

2012-01-06 Thread Benjamin West
Benjamin West bew...@gmail.com added the comment: Ok, Steven, that sounds reasonable. I checked out git-svn python and started comparing diffs... I'm a little confused. What version of argparse should be patched to provide this feature? My HG version from https://code.google.com/p/argparse/

[issue9253] argparse: optional subparsers

2012-01-06 Thread Éric Araujo
Éric Araujo mer...@netwok.org added the comment: You should work in the 3.3 standard library, i.e. on Lib/argparse.py in the default branch of the CPython Mercurial repository. See the devguide for more info. Thanks! -- ___ Python tracker

[issue9253] argparse: optional subparsers

2011-12-15 Thread Steven Bethard
Steven Bethard steven.beth...@gmail.com added the comment: If you can make your patch relative to the cpython source tree, and add a couple tests, it will be easier to review. Thanks for working on this! -- ___ Python tracker rep...@bugs.python.org

[issue9253] argparse: optional subparsers

2011-09-24 Thread Benjamin West
Benjamin West bew...@gmail.com added the comment: I spent some time looking at this, as I was interested in using this pattern to simulate what git and hg do. I considered a few modifications and then found this bug. I think the default keyword passed to _SubParsersAction.__init__ makes sense.

[issue9253] argparse: optional subparsers

2011-09-24 Thread Benjamin West
Benjamin West bew...@gmail.com added the comment: https://github.com/bewest/argparse/tree/bewest https://bitbucket.org/bewest/argparse/changesets I think this does the right thing. -- hgrepos: +69 ___ Python tracker rep...@bugs.python.org

[issue9253] argparse: optional subparsers

2011-08-29 Thread Éric Araujo
Changes by Éric Araujo mer...@netwok.org: -- stage: test needed - needs patch versions: +Python 3.3 -Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9253 ___

[issue9253] argparse: optional subparsers

2011-08-22 Thread Zsolt Cserna
Changes by Zsolt Cserna zsolt.cse...@morganstanley.com: -- nosy: +csernazs ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9253 ___ ___

[issue9253] argparse: optional subparsers

2011-07-01 Thread Dan Sully
Changes by Dan Sully dsu...@gmail.com: -- nosy: +dsully ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9253 ___ ___ Python-bugs-list mailing list

[issue9253] argparse: optional subparsers

2010-11-16 Thread Steven Bethard
Steven Bethard steven.beth...@gmail.com added the comment: I think the proposed API looks fine and should be backwards compatible since add_subparsers will currently throw an exception with a default= argument. In case someone feels like writing a patch, you'll want to look at

[issue9253] argparse: optional subparsers

2010-08-10 Thread Steven Bethard
Steven Bethard steven.beth...@gmail.com added the comment: Seems like there's minimally the bug that argparse should currently throw an error if you add an argument after subparsers (since that argument will never be parsed under the current semantics). I do believe that supporting an

[issue9253] argparse: optional subparsers

2010-08-10 Thread Michael . Elsdörfer
Michael.Elsdörfer mich...@elsdoerfer.info added the comment: To expand on my case from issue9540, I have a bunch of commands, each of which should enable a specific subset of options only available the individual command, but all of the commands share the same behavior in taking nargs='*'

[issue9253] argparse: optional subparsers

2010-08-10 Thread Éric Araujo
Éric Araujo mer...@netwok.org added the comment: Stable releases don’t go into stable branches, so I’m editing versions. I also remove 3.3 since it doesn’t exist now, it means “this won’t go in 3.2”. -- nosy: +merwok versions: -Python 2.7, Python 3.3

[issue9253] argparse: optional subparsers

2010-08-10 Thread Éric Araujo
Éric Araujo mer...@netwok.org added the comment: Wow, it is late. I wanted to write: New features don’t go into stable branches. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9253 ___

[issue9253] argparse: optional subparsers

2010-08-09 Thread Michael . Elsdörfer
Changes by Michael.Elsdörfer mich...@elsdoerfer.info: -- nosy: +elsdoerfer ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9253 ___ ___

[issue9253] argparse: optional subparsers

2010-08-08 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: See also 9540, which has an alternate proposal (that I don't like as much) for how to handle parser arguments supplied after subparsers are declared. Reviewing this, I'm now +1 on fixing this *somehow*, since clearly there is an

[issue9253] argparse: optional subparsers

2010-07-14 Thread Vincent Driessen
Vincent Driessen vinc...@datafox.nl added the comment: Actually, this is a rather common concept. Broadly used tools like for example Git use this kind of subcommand handling. This command shows all remotes: git remote(i.e. is like git remote list) Showing/removing remotes is

[issue9253] argparse: optional subparsers

2010-07-13 Thread Vincent Driessen
Vincent Driessen nvi...@gmail.com added the comment: Changed the title, so it shows that the feature request is for argparse. -- title: optional subparsers - argparse: optional subparsers ___ Python tracker rep...@bugs.python.org

[issue9253] argparse: optional subparsers

2010-07-13 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: I've added Steven as nosy so he knows this was reposted here. I've also set the priority to low. Personally I'm at least -0 on this, since if I use a command that has subcommands I expect to get an error if I supply an invalid

[issue9253] argparse: optional subparsers

2010-07-13 Thread R. David Murray
Changes by R. David Murray rdmur...@bitdance.com: -- priority: normal - low ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9253 ___ ___

[issue9253] argparse: optional subparsers

2010-07-13 Thread R. David Murray
Changes by R. David Murray rdmur...@bitdance.com: -- stage: - unit test needed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9253 ___ ___