[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: TAB completion after "nice"
From: |
Chet Ramey |
Subject: |
Re: TAB completion after "nice" |
Date: |
Thu, 25 Mar 2004 08:44:41 -0500 |
> "Peter D." <psd@alphalink.com.au> wrote:
> > Almost does what I want.
>
> If the built-in facilities aren't quite right for your situation, you
> could try making a shell function for use with complete -F to
> fine-tune. I don't have any experience with that myself; in
> particular, I don't know how to produce different completions for the
> first argument than for later arguments (or whether it's possible).
It's possible. That's the function of the COMP_WORDS array and the
COMP_CWORD index variable.
You should poke around and look for Ian Macdonald's slick `bash_complete'
package. He has done much of the work for you -- in fact, his package
provides a completion function for `nice'.
Start with http://www.caliban.org/bash/index.shtml#completion.
Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
( ``Discere est Dolere'' -- chet )
Live...Laugh...Love
Chet Ramey, ITS, CWRU chet@po.cwru.edu http://tiswww.tis.cwru.edu/~chet/