bash-completion

A confusion about ${array[*]} versus ${array[@]} in the context of a Bash completion

I'm taking a stab at writing a Bash completion for the first time, and I'm a bit confused about about the two ways of dereferencing Bash arrays (${array[@]} and ${array[*]}). Here's the relevant chunk of code (it works, by the way, but I would like to understand it better): _switch() { local cur perls local ROOT=${PERLBREW_ROO...

Accesssing bash completions for specific commands programmatically

I'm trying to write a small command launcher application, and would like to use bash's tab completions in my own completion system. I've been able to get a list of completions for general commands using compgen -abck. However, I would also like to get completions for specific commands: for instance, the input git p should display complet...

bash_completion for Rails 3

Is there any bash_completion script ready for Rails 3? ...

Showing only the substrings of COMPREPLY bash completion options to the user

In a bash completion script, suppose COMPREPLY=(aa/ba/ aa/bb/). When the script is invoked, the completion options looks like this to the user: $ foo aa/b<TAB> aa/ba/ aa/bb/ However, I want to have a bit more control over how these options are displayed. In particular, I want to show only a substring of each COMPREPLY option to the us...