[Bash-completion-devel] vncviewer
Guillaume Rousse
Guillaume.Rousse at inria.fr
Thu Feb 26 11:26:03 UTC 2009
David Paleino a écrit :
> On Wed, 25 Feb 2009 23:05:33 +0100, Freddy Vulto wrote:
>
>> Do we have a standardized way in bash-completion for selecting alternative
>> completions?
>
> No :/
>
> I believe we could do something a _get_alternative() function: in
> Debian/Ubuntu/thelike it would check the symlinks in /etc/alternatives/, in
> other distributions we might ask whether they have something similar (also
> using external tools is good, just need to be sure they're there) -- and then,
> complete "vncviewer" depending on the alternative. something like
>
> case "$alternative" in:
> "tightvnc")
> complete -f _tightvnc vncviewer ;;
> "vncfoobar")
> complete -f _vncfoobar vncviewer ;;
> esac
>
> Obviously, $alternative would be handled by some other code there.
This would only work if the related command is handled by alternative
system in the linux distribution...In mandrivalinux, we only have tightvnc.
I think it's more generic to have different files in contrib directory,
and let packagers do the right thing (tm): either not ship files
irrelevant to their distribution in the bash-completion package, or ship
it without installing it in /etc/bash_completion.d, etc... In my own
case, I'd install both files in /usr/share/bash-completion, but only
symlinks /usr/share/bash-completion/tightvnc to /etc/bash_completion.d.
--
BOFH excuse #426:
internet is needed to catch the etherbunny
More information about the Bash-completion-devel
mailing list