[Bash-completion-commits] [SCM] bash-completion branch, master, updated. 2c475419b73fbbbd63dc2c78e453f8256e8a6560
Ville Skyttä
ville.skytta at iki.fi
Sat Dec 26 11:35:18 UTC 2009
The following commit has been merged in the master branch:
commit 2c475419b73fbbbd63dc2c78e453f8256e8a6560
Author: Ville Skyttä <ville.skytta at iki.fi>
Date: Sat Dec 26 13:32:57 2009 +0200
Install known hosts only completion for generic vncviewer.
For example Fedora uses tigervnc without symlinks from which it could
be recognized, and neither tightvncviewer nor xvnc4viewer completions
seem quite appropriate for it at the moment.
diff --git a/contrib/vncviewer b/contrib/vncviewer
index 3eefc19..d3e5c59 100644
--- a/contrib/vncviewer
+++ b/contrib/vncviewer
@@ -6,7 +6,8 @@ _vncviewer_bootstrap()
local fname
case "$(_realcommand vncviewer)" in
*xvnc4viewer) fname=_xvnc4viewer ;;
- *tightvncviewer|*) fname=_tightvncviewer ;;
+ *tightvncviewer) fname=_tightvncviewer ;;
+ *) fname=_vncviewer ;;
esac
# Install real completion for subsequent completions
@@ -14,11 +15,15 @@ _vncviewer_bootstrap()
$fname # Generate completions once for now
unset -f _vncviewer_bootstrap
} &&
-complete -F _vncviewer_bootstrap vncviewer
+complete -F _vncviewer_bootstrap vncviewer &&
+_vncviewer()
+{
+ COMPREPLY=()
+ local cur=`_get_cword`
+ _known_hosts_real "$cur"
+}
-# _tightvncviewer is our default in bootstrap above, so always define it
-# even if only vncviewer is available.
-have vncviewer || have tightvncviewer &&
+have tightvncviewer &&
_tightvncviewer()
{
local cur prev
@@ -53,8 +58,8 @@ _tightvncviewer()
else
_known_hosts_real "$cur"
fi
-}
-have tightvncviewer && complete -F _tightvncviewer tightvncviewer
+} &&
+complete -F _tightvncviewer tightvncviewer
# NOTE: - VNC Viewer options are case insensitive.
--
bash-completion
More information about the Bash-completion-commits
mailing list