Skip to content

Commit

Permalink
xvnc4viewer: code cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
scop committed Apr 25, 2019
1 parent d31f2c9 commit 3e193ed
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions completions/vncviewer
Original file line number Diff line number Diff line change
Expand Up @@ -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])
-preferredencoding)
COMPREPLY=( $(compgen -W 'zrle hextile raw' -- "$cur") )
return
;;
# -via
-[vV][iI][aA])
-via)
_known_hosts_real -- "$cur"
return
;;
Expand Down

0 comments on commit 3e193ed

Please sign in to comment.