[issue9234] argparse: aliases for positional arguments (subparsers)

2010-12-18 Thread Steven Bethard
Steven Bethard steven.beth...@gmail.com added the comment: Looks good to me. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9234 ___ ___

[issue9234] argparse: aliases for positional arguments (subparsers)

2010-12-18 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: Steven, can you go ahead and apply this? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9234 ___

[issue9234] argparse: aliases for positional arguments (subparsers)

2010-12-18 Thread Steven Bethard
Steven Bethard steven.beth...@gmail.com added the comment: Applied in r87362. -- resolution: - fixed stage: - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9234

[issue9234] argparse: aliases for positional arguments (subparsers)

2010-12-17 Thread Steven Bethard
Steven Bethard steven.beth...@gmail.com added the comment: The patch looks basically okay to me, though this line makes me nervous: dest += ' (%s)' % ', '.join(aliases) Since this is just for help formatting, can't you just modify metavar instead? The dest is the attribute on the namespace

[issue9234] argparse: aliases for positional arguments (subparsers)

2010-12-17 Thread Georg Brandl
Georg Brandl ge...@python.org added the comment: I can see that this is really useful; approved for beta2 as soon as Steven's issue from the last message is handled. -- assignee: georg.brandl - bethard priority: normal - release blocker ___ Python

[issue9234] argparse: aliases for positional arguments (subparsers)

2010-12-17 Thread Adrian Sampson
Adrian Sampson asamp...@cs.washington.edu added the comment: Thanks for the suggestion, Steven. I hadn't yet internalized the difference between dest and metavar. This version of the patch modifies metavar instead. Because it looks like this issue is up for 3.2b2, I've modified NEWS and ACKS

[issue9234] argparse: aliases for positional arguments (subparsers)

2010-12-16 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: Georg, I believe this should go in 3.2. The alias capability is an essential part of what subparsers are all about and these absence of aliases would leave them partially crippled (i.e. unable to emulate the likes of svn

[issue9234] argparse: aliases for positional arguments (subparsers)

2010-12-15 Thread Adrian Sampson
Adrian Sampson asamp...@cs.washington.edu added the comment: Great. I've added a simple example to the documentation for argparse. I also added a space to the comma separator in the alias list, but I'm worried that adding 'aliases:' will make the help less readable (especially if every command

[issue9234] argparse: aliases for positional arguments (subparsers)

2010-12-15 Thread Łukasz Langa
Łukasz Langa luk...@langa.pl added the comment: Georg, be our hero here. I would be disappointed if this missed 3.2 and made us wait another 18 months (or 3 years for Linux distribution inclusion) for that feature. This feature makes the first edition of argparse in py3k complete in terms of

[issue9234] argparse: aliases for positional arguments (subparsers)

2010-12-15 Thread Éric Araujo
Éric Araujo mer...@netwok.org added the comment: Looks good and ready to me. Regarding “alias” in help text, note that Mercurial prints it (using one line for them) but Subversion puts aliases in parentheses just after the main command name, which works very for me (not a beginner). Stephen,

[issue9234] argparse: aliases for positional arguments (subparsers)

2010-12-13 Thread Éric Araujo
Éric Araujo mer...@netwok.org added the comment: Patch looks good. Can you add tests for the new functionality? (This is listed in the link I gave you :) Note: this code if 'aliases' in kwargs: aliases = kwargs.pop('aliases') else: aliases = () can be shortened to

[issue9234] argparse: aliases for positional arguments (subparsers)

2010-12-13 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: +1 on this feature request -- nosy: +rhettinger ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9234 ___

[issue9234] argparse: aliases for positional arguments (subparsers)

2010-12-13 Thread Adrian Sampson
Adrian Sampson asamp...@cs.washington.edu added the comment: Sorry I'm slow. Here's a new patch that includes tests. I'll also write documentation if that would be helpful, although I'm not very familiar with the style recommendations. -- Added file:

[issue9234] argparse: aliases for positional arguments (subparsers)

2010-12-13 Thread Éric Araujo
Éric Araujo mer...@netwok.org added the comment: Thanks for the quick update! +1 (1alias1,1alias2) I think there should be a space after the comma. Maybe “aliases:” could also be prepended, for clarity. Help about the docs: http://docs.python.org/dev/documenting/ --

[issue9234] argparse: aliases for positional arguments (subparsers)

2010-12-12 Thread Adrian Sampson
Adrian Sampson asamp...@cs.washington.edu added the comment: Thanks for the pointer, Éric. Here's a quick patch that integrates the same functionality into the existing subparser class. -- keywords: +patch Added file: http://bugs.python.org/file20026/argparse-aliases.patch

[issue9234] argparse: aliases for positional arguments (subparsers)

2010-11-27 Thread Éric Araujo
Éric Araujo mer...@netwok.org added the comment: It seems to me that this alias functionality should be integrated into the subparsers code, not another action. Guidelines for patches are at http://www.python.org/dev/patches/ Thanks in advance. (Complementary idea for another bug report:

[issue9234] argparse: aliases for positional arguments (subparsers)

2010-07-13 Thread R. David Murray
Changes by R. David Murray rdmur...@bitdance.com: -- nosy: +bethard versions: +Python 3.2 -Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9234 ___

[issue9234] argparse: aliases for positional arguments (subparsers)

2010-07-12 Thread Adrian Sampson
New submission from Adrian Sampson asamp...@cs.washington.edu: The argparse module supports subparsers, which allow CLI tools to support invocation of subcommands (much like the svn or hg programs). For these subcommands, it is often useful to allow multiple names for the same command. For