summaryrefslogtreecommitdiffstats
path: root/completions/vncviewer
diff options
context:
space:
mode:
Diffstat (limited to 'completions/vncviewer')
-rw-r--r--completions/vncviewer74
1 files changed, 37 insertions, 37 deletions
diff --git a/completions/vncviewer b/completions/vncviewer
index ba55226..17dd7da 100644
--- a/completions/vncviewer
+++ b/completions/vncviewer
@@ -1,74 +1,74 @@
# bash completion for vncviewer -*- shell-script -*-
-_vncviewer_bootstrap()
+_comp_cmd_vncviewer__bootstrap()
{
- local fname
- case $(_realcommand vncviewer) in
- *xvnc4viewer) fname=_xvnc4viewer ;;
- *tightvncviewer) fname=_tightvncviewer ;;
- *) fname=_known_hosts ;;
+ local fname REPLY
+ _comp_realcommand vncviewer
+ case $REPLY in
+ *xvnc4viewer) fname=_comp_cmd_xvnc4viewer ;;
+ *tightvncviewer) fname=_comp_cmd_tightvncviewer ;;
+ *) fname=_comp_complete_known_hosts ;;
esac
# Install real completion for subsequent completions
complete -F $fname vncviewer
- $fname # Generate completions once for now
- unset -f _vncviewer_bootstrap
+ $fname "$@" # Generate completions once for now
+ unset -f "$FUNCNAME"
} &&
- complete -F _vncviewer_bootstrap vncviewer
+ complete -F _comp_cmd_vncviewer__bootstrap vncviewer
-_tightvncviewer()
+_comp_cmd_tightvncviewer()
{
- local cur prev words cword
- _init_completion || return
+ local cur prev words cword comp_args
+ _comp_initialize -- "$@" || return
case $prev in
-passwd)
- _filedir
+ _comp_compgen_filedir
return
;;
-encodings)
- COMPREPLY=($(compgen -W 'copyrect tight hextile zlib corre rre
- raw' -- "$cur"))
+ _comp_compgen -- -W 'copyrect tight hextile zlib corre rre raw'
return
;;
-via)
- _known_hosts_real -- "$cur"
+ _comp_compgen_known_hosts -- "$cur"
return
;;
esac
if [[ $cur == -* ]]; then
- COMPREPLY=($(compgen -W '-help -listen -via -shared -noshared
- -viewonly -fullscreen -noraiseonbeep -passwd -encodings -bgr233
- -owncmap -truecolour -truecolor -depth -compresslevel -quality
- -nojpeg -nocursorshape -x11cursor' -- "$cur"))
+ _comp_compgen -- -W '-help -listen -via -shared -noshared -viewonly
+ -fullscreen -noraiseonbeep -passwd -encodings -bgr233 -owncmap
+ -truecolour -truecolor -depth -compresslevel -quality -nojpeg
+ -nocursorshape -x11cursor'
else
- _known_hosts_real -- "$cur"
+ _comp_compgen_known_hosts -- "$cur"
fi
} &&
- complete -F _tightvncviewer tightvncviewer
+ complete -F _comp_cmd_tightvncviewer tightvncviewer
# NOTE: - VNC Viewer options are case insensitive.
# Preferred case is taken from -help.
-_xvnc4viewer()
+_comp_cmd_xvnc4viewer()
{
- local cur prev words cword
- _init_completion || return
+ local cur prev words cword comp_args
+ _comp_initialize -- "$@" || return
# Both single dash (-) and double dash (--) are allowed as option prefix
local opt=${prev/#--/-}
case ${opt,,} in
# -passwd, -PasswordFile
-passwd | -passwordfile)
- _filedir
+ _comp_compgen_filedir
return
;;
-preferredencoding)
- COMPREPLY=($(compgen -W 'zrle hextile raw' -- "$cur"))
+ _comp_compgen -- -W 'zrle hextile raw'
return
;;
-via)
- _known_hosts_real -- "$cur"
+ _comp_compgen_known_hosts -- "$cur"
return
;;
esac
@@ -83,17 +83,17 @@ _xvnc4viewer()
WMDecorationWidth ZlibLevel)
[[ $cur == --* ]] && dash=-- || dash=-
- local IFS=$' \t\n' reset=$(shopt -p nocasematch)
- shopt -s nocasematch
- local option
- COMPREPLY=($(for option in "${options[@]}"; do
- [[ $dash$option == "$cur"* ]] && printf '%s\n' $dash$option
- done))
- $reset
+ _comp_split COMPREPLY "$(
+ shopt -s nocasematch
+ local option
+ for option in "${options[@]}"; do
+ [[ $dash$option == "$cur"* ]] && printf '%s\n' "$dash$option"
+ done
+ )"
else
- _known_hosts_real -- "$cur"
+ _comp_compgen_known_hosts -- "$cur"
fi
} &&
- complete -F _xvnc4viewer xvnc4viewer
+ complete -F _comp_cmd_xvnc4viewer xvnc4viewer
# ex: filetype=sh