diff options
Diffstat (limited to 'completions/vncviewer')
-rw-r--r-- | completions/vncviewer | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/completions/vncviewer b/completions/vncviewer index 9b307331..000ba1a8 100644 --- a/completions/vncviewer +++ b/completions/vncviewer @@ -27,8 +27,8 @@ _tightvncviewer() return ;; -encodings) - COMPREPLY=( $( compgen -W 'copyrect tight hextile zlib corre rre - raw' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'copyrect tight hextile zlib corre rre + raw' -- "$cur") ) return ;; -via) @@ -39,10 +39,10 @@ _tightvncviewer() if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-help -listen -via -shared -noshared + COMPREPLY=( $(compgen -W '-help -listen -via -shared -noshared -viewonly -fullscreen -noraiseonbeep -passwd -encodings -bgr233 -owncmap -truecolour -truecolor -depth -compresslevel -quality - -nojpeg -nocursorshape -x11cursor' -- "$cur" ) ) + -nojpeg -nocursorshape -x11cursor' -- "$cur") ) else _known_hosts_real -- "$cur" fi @@ -52,26 +52,24 @@ complete -F _tightvncviewer tightvncviewer # NOTE: - VNC Viewer options are case insensitive. # Preferred case is taken from -help. -# - Both single dash (-) and double dash (--) are allowed as option prefix _xvnc4viewer() { local cur prev words cword _init_completion || return - # Convert double dash to single dash - case ${prev/#--/-} in + # Both single dash (-) and double dash (--) are allowed as option prefix + local opt=${prev/#--/-} + case ${opt,,} in # -passwd, -PasswordFile - -[pP][aA][sS][sS][wW][dD]|-[pP][aA][sS][sS][wW][oO][rR][dD][fF][iI][lL][eE]) + -passwd|-passwordfile) _filedir return ;; - # -PreferredEncoding - -[pP][rR][eE][fF][eE][rR][rR][eE][dD][eE][nN][cC][oO][dD][iI][nN][gG]) - COMPREPLY=( $( compgen -W 'zrle hextile raw' -- "$cur" ) ) + -preferredencoding) + COMPREPLY=( $(compgen -W 'zrle hextile raw' -- "$cur") ) return ;; - # -via - -[vV][iI][aA]) + -via) _known_hosts_real -- "$cur" return ;; @@ -87,11 +85,11 @@ _xvnc4viewer() WMDecorationWidth ZlibLevel ) [[ "$cur" == --* ]] && dash=-- || dash=- - local IFS=$' \t\n' reset=$( shopt -p nocasematch ); shopt -s nocasematch + local IFS=$' \t\n' reset=$(shopt -p nocasematch); shopt -s nocasematch local option - COMPREPLY=( $( for option in "${options[@]}"; do + COMPREPLY=( $(for option in "${options[@]}"; do [[ $dash$option == "$cur"* ]] && printf '%s\n' $dash$option - done ) ) + done) ) $reset else _known_hosts_real -- "$cur" |