/bash_completion_lib/complete/vncviewer
http://github.com/brinkman83/bashrc · #! · 30 lines · 23 code · 7 blank · 0 comment · 0 complexity · cee50f7e6950486674e2d8bada4009bb MD5 · raw file
- # vncviewer(1) completion
- comp_include _get_cword _known_hosts
- _vncviewer()
- {
- local cur prev
- local -a config
-
- COMPREPLY=()
- cur=`_get_cword`
- prev=${COMP_WORDS[COMP_CWORD-1]}
- case "$prev" in
- -via)
- _known_hosts -a
- ;;
- *)
- # 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 ) )
- esac
-
- return 0
- } # _vncviewer()