[Bash-completion-devel] vncviewer

Freddy Vulto fvulto at gmail.com
Wed Feb 18 21:30:33 UTC 2009


On Tue, Feb 17, 2009 at 7:52 PM, Ville Skyttä <ville.skytta at iki.fi> wrote:
> On Sunday 15 February 2009, Freddy Vulto wrote:
>> The following commit has been merged in the master branch:
>> commit 20278a41473544d43c51095ba2e118fc7b89c0d5
>> Author: Freddy Vulto <fvulto at gmail.com>
>> Date:   Sun Feb 15 21:56:01 2009 +0100
>>
>>     Reviewed `to_review/vncviewer':
>>     - added support for case-insensitive options
>>     - added support for double-dash
>>     - replaced options with options from vncviewer-4.1.1 (Ubuntu-8.10)
>
> There's already vncviewer completion in the main bash_completion file, and it
> seems to do something quite funky the to_review/ one does not.  I don't have
> a clue about vncviewer, just making sure that people looking into this are
> aware that there are two implementations and are prepared to merge them
> when/if appropriate, and remove the "built-in" one when the to_review/ one
> graduates.

The vncviewer completion in the main bash_completion file does some
funky stuff indeed:

	*)
		# ssh into the the server, find and ping the broadcast address, then
		# sort and show the results.
		COMPREPLY=( $( ssh -o 'Batchmode yes' $prev \
			"ping -bnc 4 255.255.255.255" 2>/dev/null | \
			awk -F ' ' '{print $4}' | \
			sort -n | uniq | egrep '[0-9]+\.[0-9]+\.' 2>/dev/null ) )

While vncviewer just expects a servername/ip-address with an open port
5900 it can connect to.  So I think the proposal of Guillaume to
replace the above with `_known_hosts' seems the best bash_completion
can do.  Also the old code above does the strange assumptions that 1)
$prev contains a hostname (?)  2) we can ssh to it (?).

Guillaume, I've reviewed & updated the to_review/vncviewer completion
and got carried away with the case-insensitive options...  Can you
confirm it's still working all right?  If there are no further
objections, I'll move the new code to contrib and will delete the old
code from the main bash_completion file.

Regards, Freddy



More information about the Bash-completion-devel mailing list