On 5/4/12 1:26 AM, velusamy Krishnan wrote:
> Dear All,
>       I am new to the readline library, I just used the example program
> which is used to complete the list of the commands. Now I just complete
> arguments for the commands. The arguments for the commands differ based on
> the given commands. So, I have to get the given command, and after pressing
> the tab I should list the possible argument for that command.
>       I know this is basic, but could not find the document to understand
> that.  Kindly anyone please help me..

Look at how bash does it (bashline.c, pcomplete.c) for the basics.  The
idea is that you use the contents of rl_line_buffer to see what the command
is, and provide completions for the word readline passes to your
application's completion function based on that.

Chet
-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    [email protected]    http://cnswww.cns.cwru.edu/~chet/

_______________________________________________
Bug-readline mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-readline

Reply via email to