2011-11-01 22:14:45 +02:00
|
|
|
# bash completion for rdesktop -*- shell-script -*-
|
2009-01-19 22:13:09 +01:00
|
|
|
|
|
|
|
_rdesktop()
|
|
|
|
{
|
2011-04-21 11:04:51 +03:00
|
|
|
local cur prev words cword
|
2011-05-04 23:21:06 +03:00
|
|
|
_init_completion -n : || return
|
2009-01-19 22:13:09 +01:00
|
|
|
|
2009-10-04 19:42:50 +02:00
|
|
|
case $prev in
|
|
|
|
-k)
|
|
|
|
COMPREPLY=( $( command ls \
|
|
|
|
/usr/share/rdesktop/keymaps 2>/dev/null | \
|
2009-12-15 23:48:10 +02:00
|
|
|
command grep -E -v '(common|modifiers)' ) )
|
2011-04-06 20:39:21 +03:00
|
|
|
COMPREPLY+=( $( command ls $HOME/.rdesktop/keymaps 2>/dev/null ) )
|
|
|
|
COMPREPLY+=( $( command ls ./keymaps 2>/dev/null ) )
|
2009-10-04 19:42:50 +02:00
|
|
|
COMPREPLY=( $( compgen -W '${COMPREPLY[@]}' -- "$cur" ) )
|
|
|
|
return 0
|
|
|
|
;;
|
|
|
|
-a)
|
|
|
|
COMPREPLY=( $( compgen -W '8 15 16 24' -- "$cur" ) )
|
|
|
|
return 0
|
|
|
|
;;
|
|
|
|
-x)
|
2011-05-04 23:21:06 +03:00
|
|
|
COMPREPLY=( $( compgen -W 'broadband modem lan' -- "$cur" ) )
|
2009-10-04 19:42:50 +02:00
|
|
|
return 0
|
|
|
|
;;
|
|
|
|
-r)
|
2011-05-04 23:21:06 +03:00
|
|
|
case $cur in
|
|
|
|
sound:*)
|
|
|
|
COMPREPLY=( $( compgen -W 'local off remote' \
|
|
|
|
-- "${cur#sound:}" ) )
|
|
|
|
;;
|
|
|
|
*:*)
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
COMPREPLY=( $( compgen -W 'comport: disk: lptport: \
|
|
|
|
printer: sound: lspci scard' -- "$cur" ) )
|
|
|
|
[[ $COMPREPLY == *: ]] && compopt -o nospace
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
return 0
|
|
|
|
;;
|
|
|
|
-u|-d|-s|-c|-p|-n|-g|-S|-T|-X)
|
2009-10-04 19:42:50 +02:00
|
|
|
return 0
|
|
|
|
;;
|
|
|
|
esac
|
2009-01-19 22:13:09 +01:00
|
|
|
|
2009-10-04 19:42:50 +02:00
|
|
|
if [[ "$cur" == -* ]]; then
|
2011-05-04 23:21:06 +03:00
|
|
|
local opts=( $( _parse_help "$1" ) )
|
|
|
|
COMPREPLY=( $( compgen -W '${opts[@]%:}' -- "$cur" ) )
|
2009-10-04 19:42:50 +02:00
|
|
|
else
|
|
|
|
_known_hosts_real "$cur"
|
|
|
|
fi
|
2009-01-19 22:13:09 +01:00
|
|
|
|
|
|
|
} &&
|
|
|
|
complete -F _rdesktop rdesktop
|
2009-10-01 20:54:51 +03:00
|
|
|
|
2009-10-04 19:42:50 +02:00
|
|
|
# ex: ts=4 sw=4 et filetype=sh
|