On Wed, Feb 23, 2011 at 5:06 AM, Clark J. Wang <dearv...@gmail.com> wrote:
> I can give you an example here:
>
> bash# vi compgen-example.sh
> _compgen_foo()
> {
>     local cmd=$1 cur=$2 pre=$3
>
>     if [[ $cur = % ]]; then
>         COMPREPLY[0]='it-works'
>     fi
> }
>
> complete -F _compgen_foo foo
> bash# source compgen-example.sh
> bash# foo %<TAB>    <-- Press TAB here
> bash# foo it-works    <-- `%' will be expanded like this

Thanks.

However this only registers for foo. What if I wanted to handle % for
everything or even better ... only at places that expect the path? Any
way to force bash to do that?

Regards,
Dawid

-- 
http://dpc.ucore.info

Reply via email to