Re: shell completion support for optparse/optik
Greg Ward <[email protected]> Wed, 17 Sep 2003 20:09:44 -0400
| Newsgroups | gmane.comp.python.optik.user |
|---|---|
| Message-ID | <[email protected]> |
On 16 September 2003, Martin Blais said:
> e.g. if you press tab after that script, only the *.tar.gz and
> *.tar.bz2 files would be listed in the completion list. if there is a
> single "*.tar.gz" file in the directory, if will be appended to the
> command line. i called it GlobCompletion, as in "the list of valid
> input files for the script is described by the following list of
> globbing patterns". i can imagine more fancy methods, regular
> expressions, methods that depend on the parameters already specified
> on the cmdline, methods that check for specific files or names
> somewhere, etc.
Cute, but IMHO this is way too special-purpose. My usual policy for
wild and crazy extensions to Optik: you prove that it's feasible and
worthwhile by extending Optik (most likely by subclassing OptionParser).
If Optik's design gets in your way, ie. it's awkward to subclass, then
I'll consider tweaking it so you can do your extension more easily. But
I'm very very unlikely to accept a change like this in the Optik core.
As for the option completion thing: I read your second post on the
subject, and I'm inclined to have the same response as above, *except*
downgrade "very very unlikely to accept" to "pretty unlikely to
accept". If you can come up with a patch that is short, sweet, elegant,
useful, and not specific to bash, then I might just consider it.
Good luck! And please take the above as encouragement to produce really
kick-ass extensions rather than discouragement. ;-)
Greg
--
Greg Ward <[email protected]> http://www.gerg.ca/
Life is too short for ordinary music.
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf