[issue12713] argparse: allow abbreviation of sub commands by users

2011-08-19 Thread Christian Ziemski

Christian Ziemski  added the comment:

I just made such a change to Python 2.7's argparse.
If there is interest I'll post a patch here.

Unfortunately I can't find the description how to produce a proper patch.
The link I found (http://www.python.org/dev/patches/) gives an error 404.

--
nosy: +chriz

___
Python tracker 
<http://bugs.python.org/issue12713>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12713] argparse: allow abbreviation of sub commands by users

2011-08-20 Thread Christian Ziemski

Christian Ziemski  added the comment:

I attached a patch against argparse.py from Python 2.7.1.

Subcommmands can now be abbreviated as long as they are unambiguous.
Otherwise an error message 'ambigous choice' will be thrown (like the 'invalid 
choice' one).

(It's my first patch, so hopefully I did it right.)

BTW: Éric mentioned aliases for argparse. 
For that I have done a patch too. 
I'll try to find the appropriate issue number here to post it.

--
keywords: +patch
Added file: http://bugs.python.org/file22957/abbrev_subcmds.patch

___
Python tracker 
<http://bugs.python.org/issue12713>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12713] argparse: allow abbreviation of sub commands by users

2011-08-20 Thread Christian Ziemski

Christian Ziemski  added the comment:

Since there seems to be no means to edit (my last) message a little followup 
regarding aliases:

I found http://bugs.python.org/issue9234 
"argparse: aliases for positional arguments (subparsers)"

That one is for version 3.2 and already closed. 
So I'll stop bugging here with aliases.

--

___
Python tracker 
<http://bugs.python.org/issue12713>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12713] argparse: allow abbreviation of sub commands by users

2011-08-20 Thread Christian Ziemski

Christian Ziemski  added the comment:

Just for my understanding:
Even "the current development/testing version: Python 3.2.2 rc 1 (August 14, 
2011)" isn't new enough here?

So I'll have to find out how to install Python 3.3 in parallel to my 2.7.1 (on 
Fedora 15).

Starting with "hg clone http://hg.python.org/cpython"; now.

Until later (after reading http://docs.python.org/devguide/ by myself of course 
;-)

--

___
Python tracker 
<http://bugs.python.org/issue12713>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12713] argparse: allow abbreviation of sub commands by users

2011-08-21 Thread Christian Ziemski

Christian Ziemski  added the comment:

>> Even "the current development/testing version: Python 3.2.2 rc 1
>> (August 14, 2011)" isn't new enough here?
>
> No.  (Where does the quote come from?) 

http://python.org/download/releases/

> Cloning http://hg.python.org/cpython#default will get you 3.3

I have 3.3 compiled and running now. :-)

> feel free to ask for anything that’s not in the devguide or not clear.

Thanks for the offer!

--

___
Python tracker 
<http://bugs.python.org/issue12713>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12713] argparse: allow abbreviation of sub commands by users

2011-08-21 Thread Christian Ziemski

Christian Ziemski  added the comment:

Attached a patch against Python 3.3

All the existing tests are still running successfully.

But I wasn't able to add additional tests for the new functionality. 
Writing proper tests is a bit over my head for now - still learning.

--
Added file: http://bugs.python.org/file22973/abbrev_subcmds_3.3.patch

___
Python tracker 
<http://bugs.python.org/issue12713>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12713] argparse: allow abbreviation of sub commands by users

2011-08-22 Thread Christian Ziemski

Christian Ziemski  added the comment:

After some interesting hours of work (learning about tests) I created a new 
patch, including my original code changes as in the former patch and the new 
additional tests as well.

--
Added file: http://bugs.python.org/file23001/abbrev_subcmds_plus_tests_3.3.patch

___
Python tracker 
<http://bugs.python.org/issue12713>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12713] argparse: allow abbreviation of sub commands by users

2013-02-27 Thread Christian Ziemski

Christian Ziemski added the comment:

Ouch, I really missed this one for a long time. :-(
(I didn't understand the workflow correctly and overlooked the reviews.)
I apologize to everyone who has been involved!

Finally I'm back here and re-did my patch for 3.4 this time.

I followed the comments of the reviewers (and Vinay's suggestion) as far as 
possible.

--
versions: +Python 3.4 -Python 3.3
Added file: http://bugs.python.org/file29271/abbrev_subcmds_incl_tests_3.4.patch

___
Python tracker 
<http://bugs.python.org/issue12713>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com