summaryrefslogtreecommitdiffstats
path: root/completions/rdesktop
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 01:03:18 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 01:03:18 +0000
commitf2621414ee5f2f601424c22f00e207903e3b6104 (patch)
tree56a856dafd1ca684bb23263cacaa723ee4f404fc /completions/rdesktop
parentAdding debian version 1:2.11-8. (diff)
downloadbash-completion-f2621414ee5f2f601424c22f00e207903e3b6104.tar.xz
bash-completion-f2621414ee5f2f601424c22f00e207903e3b6104.zip
Merging upstream version 1:2.12.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'completions/rdesktop')
-rw-r--r--completions/rdesktop35
1 files changed, 16 insertions, 19 deletions
diff --git a/completions/rdesktop b/completions/rdesktop
index 54c1ae6..42d2ccb 100644
--- a/completions/rdesktop
+++ b/completions/rdesktop
@@ -1,39 +1,34 @@
# bash completion for rdesktop -*- shell-script -*-
-_rdesktop()
+_comp_cmd_rdesktop()
{
- local cur prev words cword
- _init_completion -n : || return
+ local cur prev words cword comp_args
+ _comp_initialize -n : -- "$@" || return
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))
- COMPREPLY=($(compgen -W '${COMPREPLY[@]}' -- "$cur"))
+ _comp_expand_glob COMPREPLY '/usr/share/rdesktop/keymaps/!(*@(common|modifiers)*) {"$HOME/.rdesktop",.}/keymaps/*' &&
+ _comp_compgen -- -W '"${COMPREPLY[@]}"'
return
;;
-*a)
- COMPREPLY=($(compgen -W '8 15 16 24' -- "$cur"))
+ _comp_compgen -- -W '8 15 16 24'
return
;;
-*x)
- COMPREPLY=($(compgen -W 'broadband modem lan' -- "$cur"))
+ _comp_compgen -- -W 'broadband modem lan'
return
;;
-*r)
case $cur in
sound:*)
- COMPREPLY=($(compgen -W 'local off remote' \
- -- "${cur#sound:}"))
+ _comp_compgen -c "${cur#sound:}" -- -W 'local off remote'
;;
*:*) ;;
*)
- COMPREPLY=($(compgen -W 'comport: disk: lptport:
- printer: sound: lspci scard' -- "$cur"))
+ _comp_compgen -- -W 'comport: disk: lptport: printer:
+ sound: lspci scard'
[[ ${COMPREPLY-} == *: ]] && compopt -o nospace
;;
esac
@@ -45,13 +40,15 @@ _rdesktop()
esac
if [[ $cur == -* ]]; then
- local opts=($(_parse_help "$1"))
- COMPREPLY=($(compgen -W '${opts[@]%:}' -- "$cur"))
+ local -a opts
+ _comp_compgen -Rv opts help
+ ((${#opts[@]})) &&
+ _comp_compgen -- -W '"${opts[@]%:}"'
else
- _known_hosts_real -- "$cur"
+ _comp_compgen_known_hosts -- "$cur"
fi
} &&
- complete -F _rdesktop rdesktop
+ complete -F _comp_cmd_rdesktop rdesktop
# ex: filetype=sh