diff options
author | Mike Crute <mike@crute.us> | 2018-09-25 10:19:18 +0000 |
---|---|---|
committer | Mike Crute <mike@crute.us> | 2018-09-30 23:09:26 +0000 |
commit | eb4b29a9a0ee71521ce920f406aa4253c94f5806 (patch) | |
tree | 80a352009b1ec85eaa6236497ba375bb13974dd7 /.bash_completion.d | |
parent | 487969f56c909689f9903b356abb2be6162c7091 (diff) | |
download | dotfiles-eb4b29a9a0ee71521ce920f406aa4253c94f5806.tar.bz2 dotfiles-eb4b29a9a0ee71521ce920f406aa4253c94f5806.tar.xz dotfiles-eb4b29a9a0ee71521ce920f406aa4253c94f5806.zip |
Add completion for hssh
Diffstat (limited to '.bash_completion.d')
-rw-r--r-- | .bash_completion.d/ssh.bash | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/.bash_completion.d/ssh.bash b/.bash_completion.d/ssh.bash index c61445f..fbbbd0c 100644 --- a/.bash_completion.d/ssh.bash +++ b/.bash_completion.d/ssh.bash | |||
@@ -10,3 +10,14 @@ function ssh_complete | |||
10 | 10 | ||
11 | complete -F ssh_complete ssh | 11 | complete -F ssh_complete ssh |
12 | fi | 12 | fi |
13 | |||
14 | if [[ -r ~/.ssh/home ]]; then | ||
15 | function home_ssh_complete | ||
16 | { | ||
17 | word=${COMP_WORDS[COMP_CWORD]} | ||
18 | allwords="$(awk '/^Host / { print $NF }' ~/.ssh/home)" | ||
19 | COMPREPLY=( $(compgen -W "$allwords" $word) ) | ||
20 | } | ||
21 | |||
22 | complete -F home_ssh_complete hssh | ||
23 | fi | ||