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

2010-12-18 Thread Steven Bethard
Steven Bethard added the comment: Applied in r87362. -- resolution: -> fixed stage: -> committed/rejected status: open -> closed ___ Python tracker ___

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

2010-12-18 Thread Raymond Hettinger
Raymond Hettinger added the comment: Steven, can you go ahead and apply this? -- ___ Python tracker ___ ___ Python-bugs-list mailing l

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

2010-12-18 Thread Steven Bethard
Steven Bethard added the comment: Looks good to me. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://m

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

2010-12-17 Thread Adrian Sampson
Adrian Sampson 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 (I hope this was the right

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

2010-12-17 Thread Georg Brandl
Georg Brandl 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 tracker

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

2010-12-17 Thread Steven Bethard
Steven Bethard 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 where the result should b

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

2010-12-16 Thread Raymond Hettinger
Raymond Hettinger 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 blame/annotate/praise). Please approv

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

2010-12-15 Thread Éric Araujo
Éric Araujo 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, what do you thin

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

2010-12-15 Thread Łukasz Langa
Łukasz Langa 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 subcommands. -

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

2010-12-15 Thread Adrian Sampson
Adrian Sampson 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 in a long list has aliase

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

2010-12-13 Thread Éric Araujo
Éric Araujo 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-13 Thread Adrian Sampson
Adrian Sampson 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: http://bugs.python.org/file20034/argparse-aliases.patch

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

2010-12-13 Thread Raymond Hettinger
Raymond Hettinger added the comment: +1 on this feature request -- nosy: +rhettinger ___ Python tracker ___ ___ Python-bugs-list maili

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

2010-12-13 Thread Éric Araujo
Éric Araujo 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 aliases = kwar

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

2010-12-12 Thread Adrian Sampson
Adrian Sampson 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 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: Automatically recogn

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

2010-07-13 Thread R. David Murray
Changes by R. David Murray : -- nosy: +bethard versions: +Python 3.2 -Python 2.7 ___ Python tracker ___ ___ Python-bugs-list mailing li

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

2010-07-12 Thread Adrian Sampson
New submission from Adrian Sampson : 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 instance, in Mercurial, "hg