[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-readline] No bug, but a question
From: |
Chet Ramey |
Subject: |
Re: [Bug-readline] No bug, but a question |
Date: |
Thu, 17 Jul 2008 08:35:03 -0400 |
> I want to implement a match-generator, that returns directory names only.
> I
> tried to use
> rl_filename_completion_function
> embedded in a function of type
> rl_compentry_func_t.
> There I tried to filter out matches, that contained a slash at the end.
> But
> all matches didn't contain a slash there. I set
> rl_filename_completion_desired
> to 1, because I read something about directories getting a slash attached
> with this variable set. Still no luck.
> What can I do? Do you probably have a function doing exactly that, for I
> think it's not too uncommon. Bash at least can do it.
You have to do the check yourself: go through the match list, stat (or lstat)
each entry, and check whether or not it is a directory. Bash has a couple of
functions to do that; one is bashline.c:test_for_directory().
Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
Chet Ramey, ITS, CWRU address@hidden http://tiswww.tis.case.edu/~chet/