On Fri, Jan 17, 2003 at 05:02:07PM +0530, Binand Raj S. wrote:
> 
> On Thu, Jan 16, 2003 at 10:49:43AM +0530, Rahul Kumar wrote:
> > I specifically meant cases like: when doing javac, only a java file
> > should be completed, when doing java only the base portion should be
> > completed, when doing a "cd" only directories should be completed, when
> > doing a cat or less, only a text file etc.
> 
> Stick this into your bash profile:
> 
> function javac_complete() { shopt -s nullglob; COMPGEN=( $( echo *.java ) ); }
> complete -o default -F javac_complete javac
> 
> 
I seem to have got it ...

function javac_complete() { shopt -s nullglob;  COMPREPLY=( $( echo
${COMP_LINE[0]}*.java ) ); }
complete -o default -X javac -F javac_complete javac

The only problem with using COMP_LINE[0] is that it throws up "javac" as
well, so i needed to exclude it in the next line. Indices 1 and 2 didnt
work out. 

re
rahul.


-------------------------------------------------------
This SF.NET email is sponsored by: Thawte.com
Understand how to protect your customers personal information by implementing
SSL on your Apache Web Server. Click here to get our FREE Thawte Apache 
Guide: http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0029en
_______________________________________________
linux-india-help mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/linux-india-help

Reply via email to