[Bash-completion-devel] Non-filename completions containing slashes and -o filenames

Todd Zullinger tmz at pobox.com
Tue May 26 16:20:45 UTC 2009


Ville Skyttä wrote:
> I'm trying to figure out how to do the right thing with non-filename
> completions containing slashes in a function that was passed to
> complete along with -o filenames.
>
> For example:
>
> _foo()
> {
>   COMPREPLY=( $( compgen -W 'a/b c/d e/f/g' -- ${COMP_WORDS[COMP_CWORD]} ) )
> }
> complete -F _foo -o filenames foo
>
> a/b, c/d and e/f/g are *not* file/path names but other completions
> that just happen to contain slashes.  Whenever I wan't some of them,
> I don't want file/dirname completion.

Heh, I ran into the same thing while working on completion for eyeD3
upstream (genre completions like 'Rock/Pop' drove me crazy).  I got
sidetracked before resolving it.  If no one here knows, asking on the
bug-bash at gnu.org list might bear fruit.

-- 
Todd        OpenPGP -> KeyID: 0xBEAF0CE3 | URL: www.pobox.com/~tmz/pgp
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Man, Debug Thyself
    -- Graffiti at People's Computer Company - 1976

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 542 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/bash-completion-devel/attachments/20090526/94d0068e/attachment.pgp>


More information about the Bash-completion-devel mailing list