]> git.alrj.org Git - zsh.d.git/blob - S40_completion
Add host completion support for cc_sync.
[zsh.d.git] / S40_completion
1 #! /usr/bin/zsh
2
3 hosts=($( ( \
4         ( [ -r ~/.ssh/config ] && awk '/^host +[a-z]/ { print $2 }' ~/.ssh/config) ; \
5         ( [ -r ~/.ssh/known_hosts ] && awk '{print $1}' ~/.ssh/known_hosts | tr , '\n') \
6 ) | sort -u))
7
8 zstyle ':completion:*:hosts' hosts $hosts
9 zstyle ':completion:*:(ssh|scp|sftp):*' hosts $hosts
10 zstyle ':completion:*:hosts' list-colors '=(#b)(*)(.lln.iba)=01;30=01;31' '=[^.]#=01;31'
11
12 users=(atihon ccadmin tcsadmin tcs clinical root)
13 zstyle ':completion:*' users $users
14
15 compdef _hosts cc_sync
16