return 0
}
+# Host completion from dsh groups.
+function _dshgroup() {
+ cur=${COMP_WORDS[COMP_CWORD]}
+
+ HOSTS=$(grep -rh '^[A-Za-z0-9]' ~/.dsh/group)
+
+ COMPREPLY=($(compgen -W "$HOSTS" -- "$cur"))
+ return 0
+}
+
+function _omnissh() {
+ cur=${COMP_WORDS[COMP_CWORD]}
+
+ HOSTS="$(grep -rh '^[A-Za-z0-9]' ~/.dsh/group)
+$(sed 's/[ ].*//;s/,/\n/' ~/.ssh/known_hosts)
+$(find $COMPLETION_DIR_SSH -type f -perm -100 2>/dev/null | sed 's@.*/@@')"
+
+ COMPREPLY=($(compgen -W "$HOSTS" -- "$cur"))
+ return 0
+}
+
# Process completion for kill, strace etc.
function _pid() {
cur=${COMP_WORDS[COMP_CWORD]}
return 0
}
-complete -F _ssh rollout
-complete -F _ssh ssh
-complete -F _ssh sshterm
+complete -F _omnissh rollout
+complete -F _omnissh ssh
+complete -F _omnissh sshterm
complete -F _ping telnet
complete -F _telnet telnetterm
complete -F _rdp rdesktop
complete -F _pid strace
complete -F _known_hosts kill_known_host
complete -F _known_hosts knh
+complete -F _omnissh knh
complete -F _modprobe modprobe
complete -F _rmmod rmmod
complete -F _global global