[issue17204] argparser's subparsers.add_parser() should accept an ArgumentParser

2014-10-09 Thread paul j3
paul j3 added the comment: In the attached patch I modified 'add_parser' to take a 'parser' keyword parameter. If given, it is used as the parser, rather than create a new one. Thus an existing parser, or one created with a custom ArgumentParser class, could be used as a subparser. In thi

[issue17204] argparser's subparsers.add_parser() should accept an ArgumentParser

2013-11-25 Thread paul j3
paul j3 added the comment: http://stackoverflow.com/a/20167038/901925 is an example of using `_parser_class` to produce different behavior in the subparsers. parser = ArgumentParser() parser.add_argument('foo') sp = parser.add_subparsers(dest='cmd') sp._parser_class = SubParser

[issue17204] argparser's subparsers.add_parser() should accept an ArgumentParser

2013-11-25 Thread Mickaël Falck
Changes by Mickaël Falck : -- nosy: +Mickaël.Falck ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail

[issue17204] argparser's subparsers.add_parser() should accept an ArgumentParser

2013-04-18 Thread paul j3
paul j3 added the comment: The 'subparsers' object has a _parser_class attribute that is normally set to the class of the parent parser. In the attached file I create a class CustomParser(argparse.ArgumentParser) that makes a parser instance which copies all of the attributes of prototype

[issue17204] argparser's subparsers.add_parser() should accept an ArgumentParser

2013-04-16 Thread Greg Trahair
Changes by Greg Trahair : -- nosy: -Greg.Trahair ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.p

[issue17204] argparser's subparsers.add_parser() should accept an ArgumentParser

2013-04-16 Thread Greg Trahair
Changes by Greg Trahair : -- nosy: +Greg.Trahair ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.py

[issue17204] argparser's subparsers.add_parser() should accept an ArgumentParser

2013-02-13 Thread Chris Jerdonek
New submission from Chris Jerdonek: Currently, argparser's subparsers.add_parser() method (for adding sub-commands) takes the following input: "This object has a single method, add_parser(), which takes a command name and any ArgumentParser constructor arguments, and returns an ArgumentParser