bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: compgen and filenames


From: Chet Ramey
Subject: Re: compgen and filenames
Date: Mon, 17 Mar 2008 11:32:39 -0400
User-agent: Thunderbird 2.0.0.12 (Macintosh/20080213)

Jonas Diemer wrote:


I have already tried the "-o filenames" option to compgen, with no success. Is what I want at all possible with the current bash (I used GNU bash, version 3.2.25(1)-release (i486-pc-linux-gnu) from KUbuntu 7.10)? If not, can you fix it (e.g. by improving the "-o filenames" option)?

The basic idea is that only the `top-level' completion function be
specified with the `-o filenames' option, and that all lower-level
completion generators return unquoted filenames.  The `-o filenames'
option tells readline to treat the completions as filenames, so it
only does any good with the completer that generates the final list
of completions to hand back to readline.

I was able to produce the behavior you want by using a completion
function specified with -o filenames and the code you included as
the function body.  Not for mercurial, though -- there's no completion
for it on my ubuntu system, so I'm not sure exactly how the completion
functions for it are structured.

Chet

--
``The lyf so short, the craft so long to lerne.'' - Chaucer
                       Live Strong.  No day but today.
Chet Ramey, ITS, CWRU    chet@case.edu    http://cnswww.cns.cwru.edu/~chet/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]