58 lines
1.7 KiB
Plaintext
Raw Normal View History

# bash completion for rdesktop -*- shell-script -*-
2009-01-19 22:13:09 +01:00
_rdesktop()
{
local cur prev words cword
_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 | \
command grep -E -v '(common|modifiers)' ) )
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)
COMPREPLY=( $( compgen -W 'broadband modem lan' -- "$cur" ) )
2009-10-04 19:42:50 +02:00
return 0
;;
-r)
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
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-04 19:42:50 +02:00
# ex: ts=4 sw=4 et filetype=sh