[Bash-completion-devel] RFC: generic redirection handling

Ville Skyttä ville.skytta at iki.fi
Tue Mar 29 20:50:08 UTC 2011


Hello,

I've been working on generic redirection handling for bash completion,
and have now something I think would be ready for committing.

The basic idea is that whenever there are redirections in the command
line (">/dev/null", "< foo", etc), we'd have a hook that would invoke
_filedir for them as appropriate, and also remove all redirections so
that completions don't have to deal with them, for example when making
assumptions about argument counts etc (even though redirections are
often at end of the command line, they can also be elsewhere).

See attached patch; it contains the _init_completion() function which
takes care of this and a couple of usage examples.  If there are no
objections, I'll commit the function and start modifying completions to
use it soon.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: redirect-handling.patch
URL: <http://lists.alioth.debian.org/pipermail/bash-completion-devel/attachments/20110329/ac20de33/attachment.asc>


More information about the Bash-completion-devel mailing list