On Fri, May 21, 2010 at 10:39 AM, Chet Ramey <chet.ra...@case.edu> wrote: > On 5/21/10 11:25 AM, Peng Yu wrote: >> When I type something after 'which', something means a command. >> However, bash doesn't do command completion for the argument after >> 'which'. Is there a way to configure bash behave depending on the >> context (in this case, do autocomplete after 'which')? > > You can start with `complete -c which' and look further at the > bash-completion package, which uses the bash programmable completion > framework to provide custom completions for a large number of commands.
complete -c works. I'm not familar with bash-completion package. How to customize search path for each command. For exmaple, I want search in $PYTHONPATH after the command python. BTW, where is the manual for the -c option of complete. There are too many 'complete' in man bash. Would you please point me which section is relevant to complete -c. -- Regards, Peng