homepage

This issue tracker has been migrated to GitHub , and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: argparse: add ability to create a bash completion script
Type: enhancement Stage: resolved
Components: Library (Lib) Versions: Python 3.3
process
Status: closed Resolution: rejected
Dependencies: Superseder:
Assigned To: Nosy List: Andrey.Kislyuk, Daniel.Walsh, bethard, dmalcolm, eric.araujo, ezio.melotti, jpokorny, tshepang
Priority: normal Keywords:

Created on 2012年02月23日 21:18 by Daniel.Walsh, last changed 2022年04月11日 14:57 by admin. This issue is now closed.

Messages (6)
msg154091 - (view) Author: Daniel Walsh (Daniel.Walsh) Date: 2012年02月23日 21:18
I have developed a new tool virt-sandbox-service using argparse. Currently the argparse has the ability to print help and usage. Being naturally lazy, I think it should be able to generate a bash_completion script also.
msg154114 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2012年02月24日 05:01
There is a module that implements this for optparse: <https://hg.furius.ca/public/optcomplete/>; I contacted the author when argparse was moved to the standard library and he told me that he would like to support argparse but had to time to code it.
optcomplete is 451 physical lines long, and 211 single logical lines long (courtesy of the sloccount program). Maybe it would be smaller after being adapted to argparse, but that’s still a large chunk of code to add, and my feeling is that it would not serve a large enough part of our users. For example, many people use zsh, which has a wholly different completion system. I’m also given to understand that some people use Windows.
The decision is Steven’s call, as argparse maintainer, but in my opinion the best course would be to update optcomplete to work with argparse, publish it on PyPI, collect feedback and download statistics, and if it proves solid and widely used, reconsider it for stdlib inclusion.
msg154126 - (view) Author: Steven Bethard (bethard) * (Python committer) Date: 2012年02月24日 09:56
Yeah, the same issues have been discussed in Issue 4256. My feeling so far is that if there isn't "one true format" that argparse can produce and be useful to a wide variety of shells, then it's probably not functionality that belongs in Python core, and instead belongs on PyPI.
msg154185 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2012年02月25日 05:40
Closing as rejected for now.
msg181299 - (view) Author: Andrey Kislyuk (Andrey.Kislyuk) * Date: 2013年02月03日 21:09
FYI: http://pypi.python.org/pypi/argcomplete 
msg181304 - (view) Author: Tshepang Lekhonkhobe (tshepang) * Date: 2013年02月03日 23:36
thanks so much; will play with it soon enough
History
Date User Action Args
2022年04月11日 14:57:27adminsetgithub: 58311
2013年07月20日 17:24:26jpokornysetnosy: + jpokorny
2013年02月03日 23:36:59tshepangsetmessages: + msg181304
2013年02月03日 21:09:08Andrey.Kislyuksetnosy: + Andrey.Kislyuk
messages: + msg181299
2012年02月25日 05:40:29eric.araujosetstatus: open -> closed
title: argparse: add ability to create a bash_completion script -> argparse: add ability to create a bash completion script
messages: + msg154185

resolution: rejected
stage: resolved
2012年02月24日 17:51:44tshepangsetnosy: + tshepang
2012年02月24日 09:56:32bethardsetmessages: + msg154126
2012年02月24日 05:04:14ezio.melottisetnosy: + ezio.melotti
2012年02月24日 05:01:19eric.araujosetnosy: + eric.araujo, bethard
title: argparser should create a bash_completion script for me. -> argparse: add ability to create a bash_completion script
messages: + msg154114

versions: + Python 3.3
2012年02月23日 21:39:55dmalcolmsettype: enhancement
components: + Library (Lib)
2012年02月23日 21:18:01Daniel.Walshcreate

AltStyle によって変換されたページ (->オリジナル) /