On Fri, Jan 16, 2009 at 11:14:47PM +0100, nadim khemir wrote:
> 1/ Why aren't all the arguments to the command passed to the completion
> script? This is purely and simply a lobotomization of the completion
> mechanism.
All the arguments typed thusfar should be available in the COMP_WORDS
array. For example, to get the previously typed argument, as well as the
argument currently being typed:
prev=${COMP_WORDS[COMP_CWORD-1]}
cur=${COMP_WORDS[COMP_CWORD]}
COMP_CWORDS is a zero-indexed array. COMP_CWORD is the index of the
word that is currently being completed.
--
Mike Kelly
_______________________________________________
Bash-completion-devel mailing list
[email protected]
http://lists.alioth.debian.org/mailman/listinfo/bash-completion-devel